MySQL Forums
Forum List  »  Stored Procedures

Continue Handler problem
Posted by: John Noble
Date: January 16, 2023 01:13PM

Hi folks,

I have getting a problem with my continuehandler. It is setting the vFInished value to 1 too early.

Here is my code...

DECLARE CONTINUE HANDLER FOR NOT FOUND SET vfinished = 1;

SET vfinished = 0;

read_loop: LOOP
FETCH shopDetailCursor INTO vStockID;


IF vfinished = 1 THEN
LEAVE read_loop;
end if;


-- Get Stock Item Cost
-- Debug code shows vfinished = 0 at this point
SELECT cost INTO vCost FROM MS1_stock WHERE ID = vStockID;
-- Debug code shows vfinished = 1 at this point. How come ??



-- Do Other Stuff


END Loop read_loop;

Any ideas what might cause this ?

John

Options: ReplyQuote


Subject
Views
Written By
Posted
Continue Handler problem
244
January 16, 2023 01:13PM


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.