MySQL Query error

The stable tester's forum for ZeosLib 7.0.x series

Report problems concerning our Delphi 2009+ version and new Zeoslib 7.0 features here.
Post Reply
thejhorse
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 07.03.2013, 18:01

MySQL Query error

Post 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?
miab3
Zeos Test Team
Zeos Test Team
Posts: 1310
Joined: 11.05.2012, 12:32
Location: Poland

Post by miab3 »

Use the TStoredProc(and TParams and ExecProc or Open), Luke.

Michal
thejhorse
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 07.03.2013, 18:01

Post 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"
miab3
Zeos Test Team
Zeos Test Team
Posts: 1310
Joined: 11.05.2012, 12:32
Location: Poland

Post 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
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post 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..
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
Post Reply