Re: equivalent of for <record> in <cursor> loop....end loop;
There isn't an equivalent to Oracles cursor for loop.
The if not done statment can be a little tricky to work out. What is acyually happening is that when the cursor can no longer return rows it raises the exception 02000 (ER_SP_FETCH_NO_DATA) which is caught by an exception handler (which you need to specify). In the example you give it must be setting a vaiable called done to 1 so that the IF statement fails.
Take the following as an alternative which may halp to make sense of what I'm saying.
http://mysql.gilfster.com/source/cursorproc2.myp
Andrew Gilfrin
------------------
http://gilfster.blogspot.com
My MySQL related Blog
http://www.mysqldevelopment.com
MySQL Stored Procedure,Trigger, View.... (Just about most things these days) Information
Edited 1 time(s). Last edit at 03/14/2006 08:29AM by Andrew Gilfrin.
Subject
Views
Written By
Posted
4266
March 14, 2006 06:15AM
Re: equivalent of for <record> in <cursor> loop....end loop;
2259
March 14, 2006 08:29AM
2173
March 15, 2006 01:37PM
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.