Cursor in MySQL stored procedures

MySQL SELECT

Cursor allows you to iterate a group of rows fetched by a query and process each row. It is read only, non-scrollable and asensitive.

Declare a cursor:

DECLARE <cursor_title> CURSOR FOR SELECT_statement;

Open a cursor:

OPEN <cursor_title>;

Fetch cursor:

FETCH <cursor_title> INTO variables list;

Close cursor:

CLOSE <cursor_title>;

For any types of queries, you can contact us on info@namasteui.com.

Leave a Reply

Your email address will not be published. Required fields are marked *