Click here to Skip to main content
15,911,646 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Is it required to use "declare" keyword at the top of stored procedure?
I need to declare a cursor. But before I could declare that cursor, I need to execute some statements to get needed values.
How to do this?

I'm using MySql 5.5.8
Thanks!
Posted
Updated 6-Feb-12 21:38pm
v3

1 solution

you can declare a value or cursor before use of in the code. So it is not a must that it should be at the top. You can declare your cursos after some statements
 
Share this answer
 
Comments
Bun Leap_kh 7-Feb-12 3:27am    
I've tried already.
- If I declare at the top beginning of stored procedure it work.
- But if I declare after some statements, it doesn't work.
I'm using MySql.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900