Reputation: 19434
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?
Upvotes: 1
Views: 336
Reputation: 2338
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.
Upvotes: 2