Ejemplo Cursor MySQL

Ejemplo Cursor MySQL DELIMITER $$ CREATE PROCEDURE createEmailList ( INOUT emailList varchar(4000) ) BEGIN DECLARE finished INTEGER DEFAULT 0; DECLARE emailAddress varchar(100) DEFAULT ""; — declare cursor for employee email DEClARE curEmail CURSOR FOR SELECT email FROM employees; — declare NOT FOUND handler DECLARE CONTINUE HANDLER FOR NOT FOUND SET finished = 1; OPEN curEmail; […]