MySQL Forums
Forum List  »  Stored Procedures

How to use cursor loop with nested stored procedure?
Posted by: KANG-WOOK LEE
Date: November 25, 2021 12:31AM

Hi.

I want to use a cursor in stored procedure as nested stored procedure call as below code. Is it possible?
Could you correct me how to write code?

-----
declare cursor cursor for
SELECT proc_sample_recordset('param');

DECLARE CONTINUE HANDLER FOR NOT FOUND SET quitLoop = TRUE;

OPEN cursor;
my_loop:
LOOP
fetch cursor into _var;

IF quitLoop THEN
LEAVE my_loop;
ELSE
-- do something
END IF;
END LOOP;
CLOSE cursor;

Options: ReplyQuote


Subject
Views
Written By
Posted
How to use cursor loop with nested stored procedure?
889
November 25, 2021 12:31AM


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.