MySQL Forums
Forum List  »  InnoDB

dependent cursors
Posted by: Joseph D'Emanuele
Date: May 20, 2005 02:25AM


Is the following scenario possible? If yes, how? I am getting error: "You have an error in your SQL syntax;.." in line 8. I have MySQL 5.0.4-beta-nt

-- a stored procedure --

1: declare done int default 0;
2: decalre cur1a int;
3: declare cur1 cursor for select a from table1;
4: declare continue handler for sqlstate '02000' set done = 1;

5: open cur1;

6: repeat
7: fetch from cur1 into cur1a;
8: declare cur2 cursor for select b,c from table2 where a = cur1a;
9: until done end repeat;

Thanks for your support

Options: ReplyQuote

Written By
dependent cursors
May 20, 2005 02:25AM
June 29, 2005 06:14AM
June 29, 2005 10:27PM
July 01, 2005 05:26AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.