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: The case preference of writing SQL, PL/SQL, SQL*PLUS comands/scripts

Re: The case preference of writing SQL, PL/SQL, SQL*PLUS comands/scripts

From: Ian Ledzion <ian.ledzion_at_lgxbow.com>
Date: Tue, 5 Jun 2001 09:37:24 +0200
Message-ID: <9fi27c$sug$1@rex.ip-plus.net>

Since Oracle is case-insensitive, you format your code in whatever way pleases you. The only rule is to decide on a convention and stick to it.

Since different programmers have their own style, we use P/L formatter from RevealNet www.revealnet.com, and use that to format all code and queries.

"Dino Hsu" <dino1_at_ms1.hinet.net> wrote in message news:0dfhht44o0un1gea4ri1bglifq6i59dbb0_at_4ax.com...
> Dear all,
>
> In Oracle PL/SQL training merterial, upper cases are used for key
> words, while lower cases for variable names (ex.1); but in many books
> about Oracle the reverse are used (ex.2).
>
> (ex.1)
> CREATE OR REPLACE FUNCTION sf_age
> (i_date IN DATE)
> RETURN NUMBER
> IS
> v_year1 NUMBER;
> v_year2 NUMBER;
> BEGIN
> v_year1 := TO_NUMBER(TO_CHAR(SYSDATE,'yyyy'));
> v_year2 := TO_NUMBER(TO_CHAR(i_date,'yyyy'));
> RETURN v_year1 - v_year2;
> END;
> /
>
> (ex.2)
> create or replace function SF_AGE
> (I_DATE in date)
> return number
> is
> V_YEAR1 number;
> V_YEAR2 number;
> begin
> V_YEAR1 := to_number(to_char(sysdate,'YYYY'));
> V_YEAR2 := to_number(to_char(I_DATE,'YYYY'));
> return V_YEAR1 - V_YEAR2;
> end;
> /
>
> Which one is the proper usage? Thanks for your comments.
>
> Dino
>
Received on Tue Jun 05 2001 - 02:37:24 CDT

Original text of this message

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