Ver Mensaje Individual
  #8  
Antiguo 16-07-2019
shoulder shoulder is offline
Miembro
 
Registrado: abr 2008
Posts: 441
Reputación: 17
shoulder Va por buen camino
Store Procedure no trae datos

Gracias, se fue el stress... me funciono como me habias indicado pero tambien agregando la linea select mails. Mil Gracias.
Cita:

CREATE PROCEDURE `usuarios`(OUT mails varchar(400))
BEGIN
DECLARE no_more_records INTEGER DEFAULT 0;
DECLARE v_email VARCHAR(100) DEFAULT "";

DECLARE cur_EventRanks CURSOR FOR
SELECT mail FROM usuario;

DECLARE CONTINUE HANDLER
FOR NOT FOUND SET no_more_records=1;

SET mails=''; -- inicializar la variable de salida
SET no_more_records = 0;

OPEN cur_EventRanks;

cur_Loop:
LOOP
FETCH cur_EventRanks INTO v_email;

IF no_more_records = 1
THEN
LEAVE cur_Loop;
END IF;

SET mails = CONCAT(v_email, ";", mails);
END LOOP cur_Loop;
select mails
CLOSE cur_EventRanks;
END



Responder Con Cita