Page 1 of 1

How crete stored procedure with query

Posted: 14.05.2009, 17:26
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

Posted: 14.05.2009, 21:52
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

Posted: 15.05.2009, 07:33
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.