Cursor in MYSQL by R4R Team

-In MySql we can also create the Cursor.
Following is the step to create a Cursor:

1. Declare the Cursor:
Syntax:
DECLARE cursor_name CURSOR FOR
Select statement;

2. Open Cursor:
Syntax:
OPEN cursor_name;

3.Fetch Cursor: Syntax:
FETCH [ NEXT [ FROM ]] cursor_name INTO variable_list;

4. Close Cursor:
Syntax:
CLOSE cursor_name;


Leave a Comment: