Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> PL/SQL constants in packages/stored packages
Hello all.
I have been attempting to store systemwide constants in a stored PL/SQL package. My first attempt was the following:
CREATE PACKAGE const AS
max_widgets_per_day CONSTANT INTEGER := 1000; END const;
Application
IF widgets > const.max_widgets_per_day THEN ...accessing const.variable_name. In order to preserve this nomenclature, I wrote one-line functions, i.e.
***
But this doesn't work. I get an "unknown column" error when
CREATE PACKAGE const AS
FUNCTION max_widgets_per_day RETURN INTEGER;
PRAGMA RESTRICT_REFERENCES (max_widgets_per_day, WNDS);
END;
CREATE PACKAGE BODY const AS
FUNCTION max_widgets_per_day RETURN INTEGER IS BEGIN RETURN 100; END;
END;
***
A whole new class of systemwide constants is about to be created corresponding to error codes, so I am revisiting the issue: is there any way to do this using the first nomenclature, rather than the second? (I haven't tried it, but as I understand it the first method works for non-stored packages, just not for stored ones.)
Many thanks.
-------------------==== Posted via Deja News ====----------------------- http://www.dejanews.com/ Search, Read, Post to UsenetReceived on Tue Jul 15 1997 - 00:00:00 CDT
![]() |
![]() |