Pregunta: | 61901 - ERROR AL EJECUTAR UN PROCEDURE DE MYSQL |
Autor: | Patricio Toscanini |
Hola, si alguíen me pudiera ayudar he intentado de varias formas y al final no consigo poder ejecutar ni un simple procedimiento almacenado en Mysql. Ya cambién versión a 5.1 trabajo con PB 9.0 y me sale
DECLARE prue PROCEDURE FOR sp_prueba ( 'arg1' ) ; execute prue ; SQLSTATE = 37000 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 '{call sp_prueba( 'arg1'}' at line 1. He probado con argunmentos, sin argumentos y el error es el mismo. De antemano gracias. |
Respuesta: | Patricio Toscanini |
integer li_edad
Después de mucho probar e investigar me encontré con esta solución y modificandola un poco logré ejecutar una función. string ls_sql ls_sql = "SELECT bd.fu_edad(param)" DECLARE my_cursor DYNAMIC CURSOR FOR SQLSA; PREPARE SQLSA FROM :ls_sql; OPEN DYNAMIC my_cursor; FETCH my_cursor INTO :li_edad; CLOSE my_cursor; messagebox("",li_edad) |
Respuesta: | Patricio Toscanini |
Después de seguir investigando llegué a la solución (por lo menos me funcionó)
integer li_edad ls_sql = "SELECT dba.fu_actualiza()" DECLARE my_cursor DYNAMIC CURSOR FOR SQLSA; PREPARE SQLSA FROM :ls_sql; OPEN DYNAMIC my_cursor; FETCH my_cursor INTO :li_edad; CLOSE my_cursor; |