MySQL Forums
Forum List  »  Stored Procedures

getting output values from procedures
Posted by: jerry kendall
Date: June 08, 2005 07:48AM

Hi all.



I have being exploring stored procedures using the C API.

How do you get output values from the procedures back into the calling 'C' program?

I know you create a stored procedure and add OUT/INOUT params.

CREATE PROCEDURE MyCount (IN tag TEXT, OUT cnt INT)
BEGIN
SELECT COUNT(*) INTO cnt FROM tbl WHERE tagname = tag;
END

But when calling from the C API, how do you get the cnt value ?


long Count = 0;
normally, rc = mysql_query(connection, "CALL MyCount("A1", Count)");


I have tried a few things but can't seem to make it work.

--
Jerry Kendall, CISSP
jerry@pentego.com
Pentego technologies Ltd.
www.pentego.com

Options: ReplyQuote


Subject
Views
Written By
Posted
getting output values from procedures
3364
June 08, 2005 07:48AM


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.