MySQL Forums
Forum List  »  Stored Procedures

Declare a cursor for stored procedure results
Posted by: Valery K
Date: June 11, 2009 01:15PM

Hello,

There are many samples how to create stored procedure and how to call it.
CREATE PROCEDURE `Results` (val INT)
BEGIN
SELECT * FROM customer WHERE id=val;
END

From manual "MySQL supports the very useful extension that allows the use of regular SELECT statements". This is great and it works from console or from Python in my tests.
mysql> call Results(1);

But I cannot (do not know how to) get the same result set when I call my stored procedure inside other stored procedure.

CREATE PROCEDURE `Calc` (val INT)
BEGIN
Call Results(1);
//Here I would like to read result set.
END

Is it possible to do? Probably I need to use Cursor. Are there any other solutions?

Thanks,
Valery.

Options: ReplyQuote


Subject
Views
Written By
Posted
Declare a cursor for stored procedure results
9851
June 11, 2009 01:15PM


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.