Yo sin querer terminé haciendo un bucle infinito que no paraba de dar nombres de libros xd tengan cuidado
-
check_circle_outlineMódulo 1 | 8 clases
Introdución
expand_more -
check_circle_outlineMódulo 2 | 3 clases
Servidor de base de datos
expand_more -
check_circle_outlineMódulo 3 | 10 clases
Base de datos y tablas
expand_more -
check_circle_outlineMódulo 4 | 8 clases
Restricciones
expand_more -
check_circle_outlineMódulo 5 | 2 clases
Modificar tablas
expand_more -
check_circle_outlineMódulo 6 | 12 clases
Sentencias basicas
expand_more -
check_circle_outlineMódulo 7 | 8 clases
Funciones
expand_more -
check_circle_outlineMódulo 8 | 12 clases
Sentencias avanzadas
expand_more -
check_circle_outlineMódulo 9 | 7 clases
Joins
expand_more -
check_circle_outlineMódulo 10 | 4 clases
Vistas
expand_more -
check_circle_outlineMódulo 11 | 7 clases
Procedimientos
expand_more -
check_circle_outlineMódulo 12 | 4 clases
Transacciones
expand_more -
check_circle_outlineMódulo 13 | 5 clases
Extras
expand_more -
check_circle_outlineMódulo 14 | 5 clases
Triggers
expand_more -
check_circle_outlineMódulo 15.-
Examen del curso
expand_more-
done_all
Examen
Examen final del curso
-
7 comentario(s)
Yo sin querer terminé haciendo un bucle infinito que no paraba de dar nombres de libros xd tengan cuidado
mysql> DELIMITER//
-> CREATE PROCEDURE libros_azar()
-> BEGIN
-> SET @iteracion = 0
-> WHILE @iteracion < 5 DO
-> SELECT libro_id, titulo FROM libros ORDER BY RAND() LIMIT 1;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DELIMITER//
CREATE PROCEDURE libros_azar()
BEGIN
SET @iteracion = 0
WHILE @it' at line 1
mysql> SET @iteracion = @iteracion + 1;
Query OK, 0 rows affected (0.03 sec)
mysql>
mysql> END WHILE;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'END WHILE' at line 1
mysql>
mysql>
mysql> END//
->
-> DELIMITER ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'END//
DELIMITER' at line 1
-> CREATE PROCEDURE libros_azar()
-> BEGIN
-> SET @iteracion = 0
-> WHILE @iteracion < 5 DO
-> SELECT libro_id, titulo FROM libros ORDER BY RAND() LIMIT 1;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DELIMITER//
CREATE PROCEDURE libros_azar()
BEGIN
SET @iteracion = 0
WHILE @it' at line 1
mysql> SET @iteracion = @iteracion + 1;
Query OK, 0 rows affected (0.03 sec)
mysql>
mysql> END WHILE;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'END WHILE' at line 1
mysql>
mysql>
mysql> END//
->
-> DELIMITER ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'END//
DELIMITER' at line 1
Al llamar al proedimiento con el ciclo while me aparece el siguiente error:
Error
Análisis estático:
Se encontraron 1 errores durante el análisis.
Expresión desaparecida. (near "ON" at position 25)
consulta SQL: Editar
SET FOREIGN_KEY_CHECKS = ON;
MySQL ha dicho: Documentación
#2014 - Commands out of sync; you can't run this command now
Error
Análisis estático:
Se encontraron 1 errores durante el análisis.
Expresión desaparecida. (near "ON" at position 25)
consulta SQL: Editar
SET FOREIGN_KEY_CHECKS = ON;
MySQL ha dicho: Documentación
#2014 - Commands out of sync; you can't run this command now
Saludos eduardo_gpg.
Excelente bloque!! Pero tengo una pregunta ¿que ventaja tiene el usar procedimientos almacenados sobre un método que haga lo mismo con el lenguaje que estemos desarrollando?
Gracias !!!
Excelente bloque!! Pero tengo una pregunta ¿que ventaja tiene el usar procedimientos almacenados sobre un método que haga lo mismo con el lenguaje que estemos desarrollando?
Gracias !!!
tengo la duda, cuando copias y pegas el ¿proceso almacenado no se debia eliminar primero? pero aqui el proceso se sobreescribe?