Re: SP ForNext equivalent
There are a couple of steps that have to be followed in order to accomplish what you need. First the cursor must be declared in the declare section, and a handler must be declared as well:
DECLARE not_found BOOLEAN DEFAULT false;
DECLARE _Cat CURSOR FOR SELECT * FROM reseller WHERE Status_id = 3;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET not_found = true;
OPEN _Cat
REPEAT
IF (not_found <> true) THEN
FETCH _Cat INTO i_Reseller_Id, c_Reseller_Name, c_Status;
END IF;
UNTIL not_found
END REPEAT;
CLOSE _Cat;
Hope this helps.
Partha Dutta
Senior Consultant, MySQL Inc.
http://www.mysql.com
Subject
Views
Written By
Posted
9341
June 13, 2005 02:26PM
6469
June 13, 2005 02:40PM
Re: SP ForNext equivalent
6549
July 01, 2005 03:40AM
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.