TZStoredProc error

Forum related to version 6.1.5 of ZeosLib's DBOs

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
ilboss
Fresh Boarder
Fresh Boarder
Posts: 14
Joined: 13.09.2006, 08:51

TZStoredProc error

Post by ilboss »

Hi to all,
I'm using ZL 6.1.5 + D6 + FB 1.5.
I wrore a Stored Procedure in FB taht work good.
I'm useing the TZStoredProc in a DataModule and the first time I use the TZStoredProc component it's all right, but when I try to use it again, I have this error:
SQL Error: dynamic SQL error parameter mismach for procedure ASSOCIA_JP. Error code: -902 Unsusseful execution caused by system error that precludes susseful execution of subsequent statement the SQL: EXECUTE PROCEDURE ASSOCIA_JP(?,?,?);
I saw a similar error in the Knowledge Base "The ZeosLib DBOs 6.1.5 - With Delphi 7 and Firebird 1.".
I try to fix it but the only ways to do that after every use:
1) disconnect ad teconnect the TZConnection component;
2) destroy and recreate the TZStoredProc;
This is the only way I can work?
I hope someone may help me.
thank's
Il Boss

I'm using TZStoredProc in thsi way:
with spAssocia do begin
ParamByName('ID_JP').AsString := id_JP;
ParamByName('ID_ANAG').AsString := id_Anag;
ExecProc;
if ParamByName('Risultato').AsInteger = 1 then
ModalResult := mrOK;
close;
dbJobPosition.Refresh;
dbElencoJP.Refresh;
end;
zippo
Silver Boarder
Silver Boarder
Posts: 322
Joined: 12.10.2005, 18:01
Location: Slovenia

Post by zippo »

Well, I use stored procedures very differently from you, so maybe it could work my way:

I use just querys, like this:

For Functions:

Code: Select all

Query1.SQL.Text := 'Select MyFunction(Param1,Param2)';
Query1.Open;
MyResultVariable := Query1.Fields[0].AsInteger;  // (AsString,... etc.)
For Procedures:

Code: Select all

Query1.SQL.Text := 'Call MyProcedure(Param1,Param2)';
Query1.ExecSQL;
It's a little primitive, but it works... (and very well!) ... :)
ilboss
Fresh Boarder
Fresh Boarder
Posts: 14
Joined: 13.09.2006, 08:51

Post by ilboss »

thank's for the help
Boss
Post Reply