
07/10/2009, 16:39
|
| | Fecha de Ingreso: junio-2009
Mensajes: 174
Antigüedad: 15 años, 9 meses Puntos: 0 | |
Respuesta: como se declara una variable de una fila de la tabla ? DECLARE CONTINUE HANDLER FOR NOT FOUND SET @termina_bucle=1;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET @termina_bucle_v=1;
SET @termina_bucle = 0;
OPEN coches;
bucle:WHILE(@termina_bucle=0) DO
FETCH coches INTO id_coche;
IF @termina_bucle=1 THEN
LEAVE bucle;
END IF;
.....
SET @termina_bucle_v = 0;
OPEN personas;
bucle_v:WHILE(@termina_bucle_v=0) DO
FETCH vuelos INTO id_persona,nombre,edad;
IF @termina_bucle_v=1 THEN
LEAVE bucle;
END IF;
......
END WHILE bucle_v;
CLOSE personas;
........
END WHILE bucle;
CLOSE coches;
Algo así estaría bien ?
Gracias. |