DECLARE CURSOR statement
The DECLARE CURSOR statement have to be used to define a cursor which you’re using in your code (for more details have a look to the CURSOR describtion).
The option WITH RETURN TO CALLER/CLIENT is necessary to return the result set back to a calling stored procedure or application.
DECLARE <cursorname> CURSOR [WITH HOLD] [WITH RETURN TO CALLER|CLIENT] FOR <sql-statement>;
create procedure myproc () result sets 1 begin declare mycur cursor with return to client for select firstnme concat ' ' concat midinit concat ' ' concat lastname from employee; open mycur; end!