[Lazarus] Get SQL before TSQLQuery execute

aradeonas aradeonas at operamail.com
Wed Jun 24 19:54:26 CEST 2015


> And the detExecute log DOES show the SQL with parameters replaced (as
> I imagined).
What version?I used last stable 1.4 release and test this code :
> procedure TForm1.SQLConnector1Log(Sender: TSQLConnection;EventType:
> TDBEventType; const Msg: String); begin ShowMessage(Msg); end;
>
>
> procedure TForm1.Button1Click(Sender: TObject); begin
> SQLConnector1.LogEvents:=[detExecute];  SQLConnector1.Connected:=True;
> SQLQuery1.SQL.Text:='INSERT INTO test(id,name) VALUE(:id,:name);';
> SQLQuery1.ParamByName('id').AsInteger:=1;
> SQLQuery1.ParamByName('name').AsString:='AABBCC';  SQLQuery1.ExecSQL;
>
> end;
>

ShowMessage just show :
> TQuerySQLStatement : INSERT INTO test(id,name) VALUE(:id,:name);

Am I doing something wrong? :/

Ara


-- 
http://www.fastmail.com - A no graphics, no pop-ups email service

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20150624/67b350a3/attachment-0003.html>


More information about the Lazarus mailing list