I’m trying to make a MySQL stored procedure and I need to know how to use a cursor.
What is a cursor and can someone supply a trivial example?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Check out the MySQL docs about cursors: Cursor Docs
Essentially, you give a cursor an SQL statement and you can access the rows returned with SQL kind of like an iterator in any conventional programming language. Word of warning though, cursors are known to be extremely slow, so avoid their usage if you can.