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: Package Constants vs Literals

Re: Package Constants vs Literals

From: klabu <klabu_at_gmail_dot_com>
Date: Thu, 19 Oct 2006 23:28:29 -0400
Message-ID: <12jggisslf8g581@corp.supernews.com>


"joel garry"
> See
>

http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:7832114438832
> to see how to figure out if it works for your exact code. Especially
> note the first and Sept. 13, 2006 responses.

1st:: 10gR2
2nd: Yes, Know all about Tom's mantra on BV.

Let me make it a bit more clear about what I'm asking about.

I'm NOT taking about in the context of an "application" Just about AD_HOC SQL (or a view) some "programmer/analyst" would write....

Is it a good practice to replace literal codes (i.e 'AWD','FBW','UEM') with pkg constants :

create package our_business_costants
is
begin
  all_wheel_drive constant varchar2(30) := 'AWD' ;   fly_by_wire constant varchar2(30) := 'FBW' ;  unearned_extortion_money constant varchar2(30) := 'UEM' ; end ;

select * from sometable
where drivetype = our_business_costants.all_wheel_drive

   and avinoicstype = our_business_costants.fly_by_wire    and fundsource = our_business_costants.unearned_extortion_money ;

Bascially I'm talking about EASE OF UNDERSTANING for say a new employee who have no idea
what codes are available and WTH they mean. Received on Thu Oct 19 2006 - 22:28:29 CDT

Original text of this message

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