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

Home -> Community -> Usenet -> c.d.o.misc -> Re: PL/SQL Coding Standards

Re: PL/SQL Coding Standards

From: Arto Viitanen <arto.viitanen_at_csc.fi>
Date: Wed, 01 Feb 2006 08:36:43 +0200
Message-ID: <43e056fc$0$10072$ba624cd0@newsread.funet.fi>


sybrandb_at_yahoo.com wrote:
> I don't think the pl/sql reference manual outlines any standards.
> In the past, Steven Feuerstein has been doing much in this respect.
> His standards are laid out in his books and -probably- on
> http://www.revealnet.com
> (which is right now dead slow)
> and in the Knowledge Expert Code Review Module in Toad.
>
> One obvious standard of course (due to scoping issues in PL/SQL) is to
> make sure your variable names are always different from column names.
> You also best prefix formal parameter definitions with p_ , like
> p_empid IN number.
>
>

Oracle's course on PL/SQL suggests to use uppercase on SQL statements, PL/SQL statements and datatypes. Variables and parameters should start with prefix p_ for parameter, v_ for variable etc. Database table and column names should be in lowercase. Also code should be indented like

IF p_x > p_y THEN

     v_max := p_x
ELSE
     v_max := p_y
END IF;

--

Arto Viitanen, CSC Ltd.
Espoo, Finland
Received on Wed Feb 01 2006 - 00:36:43 CST

Original text of this message

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