MySQL Forums
Forum List  »  Spanish

Duda y problema con LOOP
Posted by: Arturo Veredas Fernandez
Date: March 22, 2015 05:33AM

Saludos, estoy haciendo un Procedure y el código es este:

Código:

BEGIN
DECLARE cur2 CURSOR FOR
SELECT Nombre, mail1 FROM AP1_2_tabla_clientes_Consulta;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET @done=1;
OPEN cur2;
loop1: Loop
FETCH cur2 INTO nombre, email;
IF @done=1 THEN
Leave loop1;
End IF;
End loop loop1;
Close cur2;
END

Me surge una duda y no consigo sacarla, cuando ejecuto este procedimiento, me devuelve una unica fila, mi intención es que me devuelva todos los valores de la tabla.

Un saludo.
Gracias.

Options: ReplyQuote


Subject
Views
Written By
Posted
Duda y problema con LOOP
1858
March 22, 2015 05:33AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.