Page 1 of 1
MySQL Query error
Posted: 07.03.2013, 18:17
by thejhorse
Hi,
i have a MySQL store procedure:
CREATE PROCEDURE spGetUserData
( IN Userid INT )
BEGIN
SELECT * FROM tableA WHERE id = Userid
END;
-- SO SIMPLE
in the zQuery
QueryA.SQL.Text := 'call spGetUserData';
Compile/run and dont work!! why?
Posted: 07.03.2013, 19:26
by miab3
Use the TStoredProc(and TParams and ExecProc or Open), Luke.
Michal
Posted: 07.03.2013, 23:20
by thejhorse
Thanks Michal for your answer.
TStoredProc = TZStoredProc ???
i get the message:
"SQL Error:Procedure spGetLogin canĀ“t return a result set in the given context"
Posted: 08.03.2013, 11:02
by miab3
@thejhorse,
You certainly have tried something like this?:
Code: Select all
ZStoredProc1.Close;
ZStoredProc1.StoredProcName:='spGetUserData';
ZStoredProc1.Params[0].Value:=50;
ZStoredProc1.Open;
Michal
Posted: 13.03.2013, 21:58
by EgonHugeist
thejhorse,
sorry for the late answer. Did Michals adivice help?
I've made some patches for the MySQL Stored-Procedures to be able to execute them with the TZQuery-Components too. But these Patches are only available on SVN..