Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Question about pragma from Nechema Glasnot
Here is a question from Nechema Glosnot which he asked me to forward to the list because he cannot access the list now. \hi ruth ...
our company changed names and somehow i cannot post to the list because of a name incompatability ....
i have a questions regarding pragma on a pl/sql package ... attached is the code when it doesn't work and when it does ... why?
thank you in advance
Nechama Glasrot
Oracle DBA
Seisint, Inc.
6601 Park of Commerce Blvd.
Boca Raton, Florida 33487
nglasrot_at_seisint.com
Direct 561.999.3977
Main 561.999.4400
Fax 561.999.4695
THIS DOESN'T:
SQL> create or replace package const is
2 c_myvalue constant number := 0;
3 end const;
4 /
Package created.
SQL>
SQL> create or replace package testme is
2 function get_myvalue return number;
3 pragma restrict_references(get_myvalue, wnds);
4 end testme;
5 /
Package created.
SQL>
SQL> create or replace package body testme is
2 function get_myvalue return number is
3 begin
4 return const.c_myvalue;
5 end get_myvalue;
6 end testme;
7 /
Warning: Package Body created with compilation errors.
SQL> show errors
Errors for PACKAGE BODY TESTME:
LINE/COL ERROR
-------- ----------------------------------------------------------------- 0/0 PL/SQL: Compilation unit analysis terminated 2/3 PLS-00452: Subprogram 'GET_MYVALUE' violates its associated pragma
THIS WORKS:
SQL> create or replace package const is
2
3 c_myvalue constant number := 0; 4 PRAGMA RESTRICT_REFERENCES(CONST, WNDS); --- added to make it work5 end const;
Package created.
SQL>
SQL> create or replace package testme is
2 function get_myvalue return number;
3 pragma restrict_references(get_myvalue, wnds);
4 end testme;
5 /
Package created.
SQL>
SQL> create or replace package body testme is
2 function get_myvalue return number is
3 begin
4 return CONST.C_MYVALUE;
5 end get_myvalue;
6 end testme;
7 /
Package body created.
SQL> SELECT TESTME.GET_MYVALUE FROM DUAL; GET_MYVALUE
0
SQL> create or replace package const is
2
3 c_myvalue constant number := 0; 4 PRAGMA RESTRICT_REFERENCES(CONST, WNDS);5 end const;
Package created.
SQL>
SQL> create or replace package testme is
2 function get_myvalue return number;
3 pragma restrict_references(get_myvalue, wnds);
4 end testme;
5 /
Package created.
SQL>
SQL> create or replace package body testme is
2 function get_myvalue return number is
3 begin
4 return CONST.C_MYVALUE;
5 end get_myvalue;
6 end testme;
7 /
Package body created.
SQL> SELECT TESTME.GET_MYVALUE FROM DUAL; GET_MYVALUE
0
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Ruth Gramolini
INET: rgramolini_at_tax.state.vt.us
Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists --------------------------------------------------------------------To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Thu Mar 22 2001 - 09:36:53 CST
![]() |
![]() |