MySQL Forums
Forum List  »  Spanish

stored procedure vs parámetro de salida
Posted by: José Mª Fueyo
Date: March 04, 2008 08:14AM

Hola a todos
Acabo de hacer mi primera prueba de procedimiento almacenado (con cuatro parámetros, tres de entrada y uno de salida). Tras varios intentos y pruebas ensayo/error, por fin consegui compilar el procedimiento. Muy sencillo. Le paso las credenciales de acceso y la versión del frontend, y devuelve un parámetro que indica sí la validación ha sido correcta (1) o no (0).
Al intentar hacer una prueba con ADO, me da un error:
"OUT or INOUT argument 4 for routine idvida.VerificarCredenciales is not a variable or NEW pseudo-variable in BEFORE trigger".

¿Alguien me puede decir algo al respecto? el código del procedimiento es el siguiente:

CREATE PROCEDURE `VerificarCredenciales` (sNombre varchar(10),
sPW varchar(10),
iVersionFE int,
out bResultado tinyint)
BEGIN
declare iCuenta int;
DECLARE iVersion int;

set @bResultado=0;
select count(IdUsuario) into iCuenta from tblUsuarios where IDUsuario=sNombre and
Clave=sPW;
if iCuenta>0 then
select IDVersion into iVersionFE from tblVersionFE;
if iVersionFE >= iVersion then
set @bResultado=1;
end if;
end if;
END;

¡Gracias!

Salu2,

Options: ReplyQuote




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.