Hi,
iam try develop with ZeosLib but it is hard.
I have a MySQL store procedure:
[font=Courier New]
CREATE PROCEDURE spGetLogin
(
IN sUsername VARCHAR(32),
IN sPassword VARCHAR(32),
INOUT iUserId INT,
INOUT iReturn INT
)
BEGIN
SELECT iReturn=userrol, iUserId=sysuserid FROM directorio.estsysusers
WHERE (usernickname = sUsername) AND (userpassword = sPassword);
END;
[/font]
in mi XE2 app, i call and get a error message:
"SQL Error:Procedure spGetLogin can´t return a result set in the given context"
what it the wrong...?
MySQL ZStoreProc error
@thejhorse,
I'd do it like this:
and
Michal
I'd do it like this:
Code: Select all
CREATE PROCEDURE spGetLogin
(
IN sUsername VARCHAR(32),
IN sPassword VARCHAR(32),
OUT iUserId INT,
OUT iReturn INT
)
BEGIN
SELECT userrol, sysuserid INTO iReturn, iUserId FROM directorio.estsysusers
WHERE (usernickname = sUsername) AND (userpassword = sPassword);
END;
Code: Select all
ZStoredProc1.Close;
ZStoredProc1.StoredProcName:='directorio.spGetLogin';
ZStoredProc1.Params[0].Value:='User1';
ZStoredProc1.Params[1].Value:='Password1';
ZStoredProc1.ExecProc;
Edit1.Text:=ZStoredProc1.Params[2].AsString+','+ZStoredProc1.Params[3].AsString