January 21st, 2013, 09:58 PM
Pass parameter as cursor type into procedure in MySQL
I have a procedure that i want to pass a parameter as CURSOR type but i dont.
Ex: Create Procedure ABC(OUT p_cursor CURSOR)
Pls help me to do this.
January 22nd, 2013, 05:08 AM
No you can't pass cursors as parameters.
What goal are you trying to achieve? Maybe I know a workaround.
January 22nd, 2013, 07:10 PM
Thanks for your reply,
I just want to take some values that return over cursor and These values i'll use in my java program for purposes.
If you have any ideas or resolves, i want to know about it.
January 23rd, 2013, 07:29 AM
Sorry, in MySQL Cursors only exist within Stored Procedure and they can't even be returned to another procedure.
I hope that this solution is acceptable:
* the procedure creates a view
* the applicazion queries that view.
Since views are always global (all users can access them), the view should have a name like:
and you should DROP it (or use CREATE OR REPLACE VIEW).
I hope this helps.