Hi All,
I am trying to fetch row by row using FOR loop on CURSOR.An i am getting Error attached screen shot:
Below is the logic:
Create Procedure TEST1() LANGUAGE SQLSCRIPT AS
BEGIN
AN01 = Select * from AN.View;
AN02 = SELECT DISTINCT F1,F2,F3 from :AN01 GROUP BY F1,F2,F3;
BEGIN
DECLARE CURSOR ITEM_RULE FOR select F1,F2,F3 from :AN02;
FOR V_ITEM_RULE AS ITEM_RULE DO
SELECT * from TABLE1 where F1 = V_ITEM_RULE.F1;
END FOR;
END;
END;
Here i an getting data from AN01..Then finding the Distinct in AN02.
On AN02 i am applying CURSOR...and for each row i wanted to find an entry in TABLE1 and do a calculation further.
-- But when i am using a FOR loop in the Nested BEGIN i am getting below Error.
-- I tried to Activate successful without FOR Loop.
Any Suggestion on the above issue.
Thanks
kalyan