selection of package constants

chsc

Member
Hi there,

I have a package specification (const) with some constants, e.g.

Code:
c_yes CONSTANT VARCHAR2 (1) := 'Y';
If I try to select this constant (even with a simple
Code:
select const.c_yes from dual;
) I get the following error:

ORA-06553: PLS-221: 'C_YES' is not a procedure or is undefined

While I can remember this special constant ;) , it's very time consuming to always to have to look up any constants in any selects I want to run..
Can anybody help me with this problem?

Thx,
Christine
 
That's just the way it works I'm afraid. PL/SQL is a wrapper for SQL, SQL doesn't know PL/SQL, except for calling functions (and even then it doesn't really know or care whether they are PL/SQL).

You can define the constants in the package body and then have functions to get their values.
 
Back
Top