MySQL Forums
Forum List  »  Triggers

re-using cursor in a trigger
Posted by: Imran Akbar
Date: June 11, 2012 11:08AM

I'm creating a trigger which needs to run a few different SELECT statements with a cursor to iterate through them. However, I'm currently creating a new cursor for each of these queries, as I can't figure out how to re-use/re-define the cursor. I'm declaring it like so:

DECLARE cur CURSOR FOR
SELECT jsc FROM cell.measurement ORDER BY date DESC LIMIT 3;

and I've tried things like SET cur CURSOR FOR... but haven't found anything that works.
Is there a way to do this?

thanks,
imran



Edited 1 time(s). Last edit at 06/11/2012 11:25AM by Imran Akbar.

Options: ReplyQuote


Subject
Views
Written By
Posted
re-using cursor in a trigger
2510
June 11, 2012 11:08AM
1232
June 12, 2012 12:39PM


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.