Does anybody know if MySQL supports the ability for a stored procedure to return a "ref cursor" (Oracle term)?
Here is an example of an Oracle procedure that returns a ref cursor:
PROCEDURE my_proc
(a_out_cursor OUT ref cursor)
IS
BEGIN
open a_out_cursor for
select col_a, col_b
from my_table;
END;
I am using Java, so I would call this procedure as follows:
CallableStatement statement = null;
Connection connection = getConnection(); //returns a java.sql.Connection
//Use factory to get statement
statement = CallableStatementFactory.getCallableStatement(connection, "call my_proc(?)");
statement.registerOutParameter(1, OracleTypes.CURSOR);
// Execute the procedure
statement.execute();
I would like to perform this same sort of fetching using MySQL instead of Oracle. Does anybody know if it is possible? Or must all CallableStatements be setup as queries and not stored procedures?
Any help is appreciated.
Here is an example of an Oracle procedure that returns a ref cursor:
PROCEDURE my_proc
(a_out_cursor OUT ref cursor)
IS
BEGIN
open a_out_cursor for
select col_a, col_b
from my_table;
END;
I am using Java, so I would call this procedure as follows:
CallableStatement statement = null;
Connection connection = getConnection(); //returns a java.sql.Connection
//Use factory to get statement
statement = CallableStatementFactory.getCallableStatement(connection, "call my_proc(?)");
statement.registerOutParameter(1, OracleTypes.CURSOR);
// Execute the procedure
statement.execute();
I would like to perform this same sort of fetching using MySQL instead of Oracle. Does anybody know if it is possible? Or must all CallableStatements be setup as queries and not stored procedures?
Any help is appreciated.