Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Coding Conventions

Re: Coding Conventions

From: <markp7832_at_my-deja.com>
Date: Wed, 26 Jan 2000 22:36:25 GMT
Message-ID: <86nst9$1vt$1@nnrp1.deja.com>


In article <86nga3$nv8$1_at_nnrp1.deja.com>,   mshabrawi_at_excite.com wrote:
> Hello,
> Is there a white paper that describes PL/SQL coding conventions ?
> Thanks
> Mohamed EL-Shabrawi
>

I do not know about a white paper but may I recommend:

start every scalar variable with a v_
start every cursor with c_
define rowtype as r_
define pl/sql tables as t_

Whenever a scalar variable will hold data that originates in, or will be inserted or updated into a table define it using the table.column% type format or as references to a previously created scalar variable defined as table.column%type.

For counters use the pls_integer type for speed.

Code only in lowercase. There is no need to capitalize language statements. (I find it easier to concentrate on the logic when the statements keywords are not jumping out at me)

Use procedures/functions in anonymous blocks to modularize the code

Use line comments, -- to isolate sections of code that you want to draw attention to such as end of large if's, end of loops, end of procedures and functions etc...

Do not over-indent.
--
Mark D. Powell -- The only advice that counts is the advice that  you follow so follow your own advice --

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Wed Jan 26 2000 - 16:36:25 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US