MySQL Forums
Forum List  »  Informix

Re: SP ForNext equivalent
Posted by: Partha Dutta
Date: July 01, 2005 03:40AM

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

Options: ReplyQuote


Subject
Views
Written By
Posted
8641
June 13, 2005 02:26PM
5942
June 13, 2005 02:40PM
Re: SP ForNext equivalent
6068
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.