Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Package Constants vs Literals
klabu wrote:
> select *
> from sometable
> where somecol = 'SOMECODE'
> and someothercol = 'SOME_OTHER_CODE'
> and someothercol2 = some_numeric_code
>
>
>
> Is this a "good" thing (meaning NO performance impact) to do:
> If those "CODES" have a finite set of values..
> create a package and put those values in constants
> and replace those literals in the SQL with the package constants ?
>
> thanks
You have asked a question that is impossible to answer.
No Oracle version.
No information with respect to the data, cardinality, etc.
The only general statement one should make about Oracle is that general statements are often incorrect.
Go to Morgan's Library at www.psoug.org. Click on Explain Plan. You will find 9 SQL statements that return the exact same result set. Which one is the best? Depends on the version of Oracle.
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace x with u to respond) Puget Sound Oracle Users Group www.psoug.orgReceived on Thu Oct 19 2006 - 16:29:50 CDT