Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Problem with PRAGMA RESTRICT_REFERENCES!
I have defined a funtion( as seen below) in my package spec.
PACAKGE xyz IS...
.........
FUNCTION correctedHours( pHr IN NUMBER, pDate IN DATE, pHrMon IN
VARCHAR2 )
RETURN NUMBER;
PRAGMA RESTRICT_REFERENCES (correctedHours, WNDS);
...................
In my package body, I implemented this function. I tried to use this function in a cursor declaration in a procedure of the package body. But
I get an error as shown below when I tried to compile it:
PLS-00452: Subprogram 'CORRECTEDHOURS' violates its associateed pragma PL/SQL: Compilation unit analysis terminated
Where am I doing it wrong? Any help would be appreciated.
My package BODY looks like this
PACKAGE BODY xyz IS
....
FUNCTION correctedHours( pHr IN NUMBER, pDate IN DATE, pHrMon IN
VARCHAR2 )
RETURN NUMBER IS
BEGIN
IF ( pDate < TO_DATE('01-JUL-1998', 'DD-MON-YYYY') ) THEN
IF ( pHrMon = '1' ) THEN return pHr * 174; END IF;
PROCEDURE makeReport( empNo VARCHAR2, startDate VARCHAR2, endDate VARCHAR2 ) IS benefitNumber VARCHAR2(1);
EmpNumber VARCHAR2(4); totalAmt NUMBER(10,2); totalHr NUMBER(8,2);
CURSOR aProjectSum IS SELECT t.type_project ||'-'||t.base_project ||'-'||t.sub_project proj, sum(trans_amount) amt,
/********** here is where I am using my function *****************/ sum(
max( project_title) title, max(unit) unit FROM transactions t, projects_far p WHERE t.cost_type_id IN ('SW', 'PS') AND t.benefit_category = benefitNumber AND t.employee_number = EmpNumber AND t.pay_ending_date >= TO_DATE(startDate, 'DD-MON-RRRR') AND t.pay_ending_date <= TO_DATE(endDate, 'DD-MON-RRRR') AND t.type_project = p.type_project AND t.base_project = p.base_project AND t.sub_project = p.sub_project group by t.type_project, t.base_project, t.sub_project order by proj;BEGIN
Any help would be appreciated,
Raj
Received on Tue Nov 10 1998 - 00:00:00 CST
![]() |
![]() |