cfcProgrammer
Programmer
Hi Everyone,
Looking for help once again!!!
Here is the code I have in a stored procedure. I am NOT getting an error,however, the select statement that builds the cursor is not executing.... I can not figure out why???? Can anyone see where my logic has gone wrong??
I thought it may be because of the begin around the for loop but if I remove it then I get a compile error stating that it is expecting a begin... ???
Thanks for help that anyone can give...
cfc
Looking for help once again!!!
![[dazed] [dazed] [dazed]](/data/assets/smilies/dazed.gif)
Here is the code I have in a stored procedure. I am NOT getting an error,however, the select statement that builds the cursor is not executing.... I can not figure out why???? Can anyone see where my logic has gone wrong??
Code:
BEGIN
DECLARE CURSOR T1 IS
SELECT EXEMPT_AMT INTO V_AMT
FROM REQUEST R, PAY_STUB PS, INCOME I
WHERE R.REQUEST_ID = PS.REQUEST_ID
AND PS.INCOME_ID = I.INCOME_ID
AND CUR_STATUS_ID IN (2253,2563,1671,2566,7327)
AND I.INCOME_SOURCE_ID = 182
AND R.CASE_ID =P_CASE_ID
AND EXEMPT_AMT <> 0
AND TO_CHAR(R.REQUEST_DATE,'YY') = TO_CHAR(SYSDATE,'YY');
BEGIN
FOR T1_REC IN T1 LOOP
V_TOT := V_TOT + V_AMT;
END LOOP;
END; --BEGIN FOR LOOP
IF V_TOT >= 500 THEN
V_TOTAL := 500;
ELSE
V_TOTAL := NVL(V_INC_SRC_EXEMPT_AMT,0) - (NVL(V_TOTAL1,0) + NVL(V_TOTAL2,0) + NVL(V_TOTAL3,0) + V_TOT);
END IF;
Thanks for help that anyone can give...
cfc