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

All,

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...)
begin
     declare exit handler for 1062
     begin 
         set sql_error = -9999;
     end

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


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?

Cheers,

Bonny

Options: ReplyQuote


Subject
Views
Written By
Posted
Can I return resultset and set out parameters in stored proc?
4574
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.