Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Using packaged constants in queries
Since you are running 8.1.7, you might want
to look at sys_context(), and use a database
logon trigger to set 'environment variables'.
Use the trigger to call a package to set the
constants - then use sys_context() in the
SQL. This has some performance and
design benefits over using packaged
constants (returned via functions).
-- Jonathan Lewis http://www.jlcomp.demon.co.uk Now running 3-day intensive seminars http://www.jlcomp.demon.co.uk/seminar.html Host to The Co-Operative Oracle Users' FAQ http://www.jlcomp.demon.co.uk/faq/ind_faq.html Author of: Practical Oracle 8i: Building Efficient Databases Alexander Miroshnikov wrote in message <6e2c7cae5af1ab22f05aa11f8f30fada.73752_at_mygate.mailgate.org>...Received on Fri Mar 01 2002 - 15:12:01 CST
>Dear colleagues,
>
>I would like to take the constant declared in my package and use it in
>my query.
>
>Please have a look at my test below -
>
>-- test package
>create or replace package my_package as
> my_const constant integer := 1;
>end;
>/
>
>-- test query
>select my_package.my_const from dual
>/
>
>-- result
>select my_package.my_const from dual
> *
>ERROR at line 1:
>ORA-00904: invalid column name
>
>Could you tell me why Oracle is unhappy and whether there is any way to
>use packaged constants in queries?
>
>Many Thanks,
>
>Alex
>
>Oracle 8.1.7 for Solaris.
>
>
>--
>Posted via Mailgate.ORG Server - http://www.Mailgate.ORG
![]() |
![]() |