MySQL Forums
Forum List  »  Stored Procedures

Re: how do I return a cursor from a function?
Posted by: Jay Pipes
Date: November 29, 2005 06:33PM

AFAIK, you cannot return a cursor from a function, only valid MySQL data types. If you think about it, this makes sense, since functions are returning what are essentially "fields" to be operated on by the SQL statement. For instance,

SELECT my_func(some_table.some_field) FROM some_table;

The my_func() function must return a scalar data type (single value), not multiple values. Perhaps what you are looking for is a stored procedure, which may *operate* on cursors and return datasets to the calling client by issuing simple SELECT statements?

Jay Pipes
Community Relations Manager, North America, MySQL Inc.

Got Cluster? http://www.mysql.com/cluster
Personal: http://jpipes.com

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: how do I return a cursor from a function?
5799
November 29, 2005 06:33PM


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.