Conventions


The use of upper and lower case is intended to make clear the identity of SQL and PL/SQL keywords. All SQL and PL/SQL code is written in lower case except for language keywords, which are upper case. The following, taken from Chapter 3, illustrates this writing style.

 
 CREATE SEQUENCE student_vehicles_pk_seq; 

Quoted expressions are often in upper case as well as all references to Oracle built-in functions. The following, taken from Chapter 11, includes references to two Oracle built-in functions (NEWTIME and SYSDATE) written in upper case.

 
 pst_date := NEW_TIME(SYSDATE, 'EST','PST'); 

Oracle provides may built-in packages. The sample code in this text refers to all built-in packages in lower case. This decision was made to make the code more readable and easier on the eyes. Excessive upper case text can be rough on the corneas. The following, from Chapter 11, illustrates the choice of lower case when writing references to the Oracle built-in package DBMS_ALERT.

 
 dbms_alert.register('OUT_OF_STOCK_ITEM'); 

The PL/SQL code examples often include counter variable declarations; these are often in upper case. The following, from Chapter 11, declares a variable, ID. This is not a keyword but is easier to read in upper case.

 
 ID   VARCHAR2(10), 

Finally non-code text, that is, the paragraphs of the text, always refers to code items in upper case. The text of a paragraph may refer to a constraint name or PL/SQL variable name , and always, the code identifier is written in upper case within the body of a paragraph.



Programming Oracle Triggers and Stored Procedures
Programming Oracle Triggers and Stored Procedures (3rd Edition) (Prentice Hall PTR Oracle Series)
ISBN: 0130850330
EAN: 2147483647
Year: 2003
Pages: 111
Authors: Kevin Owens

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net