How crete stored procedure with query

In this forum we will discuss things relating the ZEOSLib 6.6.x stable versions

Moderators: gto, EgonHugeist

Post Reply
Fortuna1
Fresh Boarder
Fresh Boarder
Posts: 9
Joined: 04.11.2007, 11:47

How crete stored procedure with query

Post by Fortuna1 »

DM1.Qs1.Close;
DM1.Qs1.SQL.Clear;
DM1.Qs1.SQL.Add('CREATE PROCEDURE UPD_DOB (IPARAM INTEGER) AS BEGIN '+
' UPDATE TABELA1 SET SALDO = :IPARAM; EXIT; END ');
DM1.Qs1.ExecSQL;

DM1.ZCs.Commit;


I use ZEOSDBO-6.6.3-stable
LAZARUS
FireBird

Problem i is :IPARAM

Program crashed in DM1.ZCs.Commit;

Thanks


How crete stored procedure with query
seawolf
Zeos Dev Team *
Zeos Dev Team *
Posts: 385
Joined: 04.06.2008, 19:50
Contact:

Post by seawolf »

When Lazarus parse DM1.ZCs.Commit, at runtime, does not display error message?

Because it appears a message to me which stated you cannot use that command if ZConnection.Autocommit is set to true.

Anyway changing :iparam to iparam stored proc works nicely
Fortuna1
Fresh Boarder
Fresh Boarder
Posts: 9
Joined: 04.11.2007, 11:47

Post by Fortuna1 »

I found where is the problem.
The .ParamCheck must be false;
and then is OK.


DM1.Qs1.ParamCheck:=FALSE;



DM1.Qs1.Close;
DM1.Qs1.SQL.Clear;
DM1.Qs1.SQL.Add('CREATE PROCEDURE UPD_DOB (IPARAM INTEGER) AS BEGIN '+
' UPDATE TABELA1 SET SALDO = :IPARAM; EXIT; END ');
DM1.Qs1.ExecSQL;

DM1.ZCs.Commit;


Thanks.
Post Reply