DECLARE CURSOR
declare cursor_name cursor
for select_statement
DECLARE CURSOR statement creates a new cursor from the SELECT statement query. The FETCH statement scrolls the cursor through the data until the variables have been loaded. Then the cursor scrolls to the next record.