Oracle Consulting Oracle Training Oracle Support Development
Home
Catalog
Oracle Books
SQL Server Books
IT Books
Job Interview Books
eBooks
Rampant Horse Books
911 Series
Pedagogue Books

Oracle Software
image
Write for Rampant
Publish with Rampant
Rampant News
Rampant Authors
Rampant Staff
 Phone
 800-766-1884
Oracle News
Oracle Forum
Oracle Tips
Articles by our Authors
Press Releases
SQL Server Books
image
image

Oracle 11g Books

Oracle tuning

Oracle training

Oracle support

Remote Oracle

STATSPACK Viewer

Privacy Policy

 

   
 

ss

Oracle Tips by Burleson 

Code Readability in PL/SQL

Code readability is important when programming.  Many times lines can be combined to reduce the size of the code but may make the code less understandable to anyone other than the author.  The example shown earlier can in fact be written with only three lines of code.

 SQL> begin
  2    dbms_output.put_line ('Hello &v_string');
  3  end;
  4  / 

Enter value for v_string: John
Hello John

White Space and Comments

As with any programming, you want your script to be as readable as possible.  Remember, you may be writing the procedure but more than likely someone else will have to update and maintain it. 

White space is added to make code more readable.  It has no impact on the execution time or efficiency of the code.  White space is use only to make the code more readable to humans.  In the examples above, the code between the begin and end key word is indented.  This makes the block boundaries easier to see in the code.  The two spaces forming the indent exists only to make the code easier to read.  Blank lines can also be used to separate sections of code.  Blank lines can appear anywhere in the code (except inside a SQLstatement).


The above book excerpt is from:

Easy Oracle PL/SQL Programming

Get Started Fast with Working PL/SQL Code Examples

ISBN 0-9759135-7-3   

John Garmany 

http://www.rampant-books.com/book_2005_1_easy_plsql.htm

Linux Oracle commands syntax poster

ION Oracle tuning software

Oracle data dictionary reference poster



Oracle Forum

BC Oracle consulting support training

BC remote Oracle DBA   

 

   

 Copyright © 1996 -2017 by Burleson. All rights reserved.


Oracle® is the registered trademark of Oracle Corporation. SQL Server® is the registered trademark of Microsoft Corporation. 
Many of the designations used by computer vendors to distinguish their products are claimed as Trademarks