MySQL Forums
Forum List  »  Oracle

Can I return resultset and set out parameters in stored proc?
Posted by: Bonny Rais
Date: January 10, 2010 05:17PM


I'm migrating Oracle PL/SQL stored procs which are very simple in nature, nothing
sophisticated, other than the exception mechanism that seems not to be supported
in MySQL (since we intend to use Cluster 7.0.9, we're limited to the database
version that it comes with - 5.1.41 from memory), so I'm trying to find out how
to support stored procedures that would report exception conditions using sql
error codes in out parameters and return the result set as the procedure's return
value. Below is an example of what I'm trying to do:

 create procedure getSession( out sql_error integer, param1...)
     declare exit handler for 1062
         set sql_error = -9999;

     call lockContext( p1, ...);
     select c1, c2, c3 from t_session where ....;

The client application uses Connector/C++.

So the two questions are:

1. Can I do the above in version 5.1.41 stored proc?
2. How does the client retrieve the two kinds of results?



Options: ReplyQuote

Written By
Can I return resultset and set out parameters in stored proc?
January 10, 2010 05:17PM

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.