Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> pragma and table count attribute

pragma and table count attribute

From: <swapna.barua_at_lmco.com>
Date: Mon, 02 Nov 1998 18:01:00 GMT
Message-ID: <71ks0s$68i$1@nnrp1.dejanews.com>


Could someone help me with the following problem and tell me how is subprogram B violating its pragma ? I did find that the reference to table.count in the function b is causing the problem :-

The Problem:
SQL> create or replace package abc as
2 PRAGMA RESTRICT_REFERENCES ( abc , WNDS ); 3 type ProfileNmType is record (

4             nm_id   number(5),
5             nm      varchar2(10));
6     type PrflNm_tbl_struct is table of ProfileNmType 7             index by
binary_integer;
8     prflNm_tbl prflNm_tbl_struct;
9   function b
10     (v_value_in in varchar2)

11 return number;
12 PRAGMA RESTRICT_REFERENCES (
13 b, WNDS );
14 end abc;
15 /

Package created.

SQL> create or replace package body abc as 2 function b
3 (v_value_in in varchar2)
4 return number as
5 i binary_integer := 0;
6 begin
7 i := prflNm_tbl.count ;
8 return 1;
9 end b;
10 end abc;
11 /

Warning: Package Body created with compilation errors.

SQL> sho err
Errors for PACKAGE BODY ABC:

LINE/COL ERROR

-------- -----------------------------------------------------------------
0/0      PL/SQL: Compilation unit analysis terminated
2/1      PLS-00452: Subprogram 'B' violates its associated pragma SQL>

The Source:

create or replace package abc as
PRAGMA RESTRICT_REFERENCES ( abc , WNDS ); type ProfileNmType is record (
nm_id number(5),
nm varchar2(10));
type PrflNm_tbl_struct is table of ProfileNmType index by binary_integer;
prflNm_tbl prflNm_tbl_struct;
function b
(v_value_in in varchar2)

return number;
PRAGMA RESTRICT_REFERENCES (
b, WNDS );
end abc;
/

create or replace package body abc as function b
(v_value_in in varchar2)

return number as
i binary_integer := 0;
begin
i := prflNm_tbl.count ;
return 1;
end b;
end abc;
/

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Mon Nov 02 1998 - 12:01:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US