stackoverflow
stackoverflow

Reputation: 19434

Defining and using a cursor

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

Answers (1)

kand
kand

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

Related Questions