Versión de MySql 5.6
Stored Procedure
Código MySQL:
Ver original
Error que devuelve
mysql> use vamosriver
No connection. Trying to reconnect...
Connection id: 593723
Current database: *** NONE ***
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> \. /home/mysql/Descargas/procedureDR.sql
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 '' at line 5
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 'DECLARE dr INT' at line 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 'DECLARE incrementa INT' at line 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 'DECLARE lastdr INT' at line 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 'DECLARE toplimit INT' at line 1
ERROR 1327 (42000): Undeclared variable: top
ERROR 1327 (42000): Undeclared variable: dr
ERROR 1193 (HY000): Unknown system variable 'lastdr'
ERROR 1193 (HY000): Unknown system variable 'toplimit'
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 'IF tu = 1 THEN
IF lastdr > toplimit THEN
SELECT dnr INTO dr FROM devriver_dn' at line 1
ERROR 1193 (HY000): Unknown system variable 'lastdr'
ERROR 1193 (HY000): Unknown system variable 'incrementa'
ERROR 1054 (42S22): Unknown column 'incrementa' in 'field list'
ERROR 1054 (42S22): Unknown column 'incrementa' in 'field list'
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 'else
SELECT dnr INTO dr FROM devriver_dnr where id = tu' at line 1
ERROR 1193 (HY000): Unknown system variable 'lastdr'
ERROR 1193 (HY000): Unknown system variable 'incrementa'
ERROR 1054 (42S22): Unknown column 'tu' in 'where clause'
ERROR 1054 (42S22): Unknown column 'incrementa' in 'field list'
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 IF' at line 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 'else
SELECT dnr INTO dr FROM devriver_dnr where id = tu' at line 1
ERROR 1193 (HY000): Unknown system variable 'lastdr'
ERROR 1193 (HY000): Unknown system variable 'incrementa'
ERROR 1054 (42S22): Unknown column 'tu' in 'where clause'
ERROR 1054 (42S22): Unknown column 'incrementa' in 'field list'
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 IF' at line 1
ERROR 1193 (HY000): Unknown system variable 'nuevodr'
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' at line 1
mysql> \t
Desde ya agradezco su ayuda.