on 03-28-2014 6:33 AM
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
Hi Kalyan,
Your procedure is incomplete.
Why are you looping to make a select that you do not use? What is the target for ITEM_RULE_GDS selection?
Also, like it is currently exposed a JOIN is highly recommended.
Are you just playing around with procedure or you really have a scope to do ?
Regards, Fernando Da Rós
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.