Subject RE: [IBO] Parametrized SQL Statement Logging
Author Support List
Johnny,

> i'm testing with IBO 4.9.9 and i would like to LOG the SQL Statements i'm
> executing. Here an little example:
>
>
> IB_wDirect: TIB_DSQL;
> IB_wDirect.Active := false;
> IB_wDirect.SQL.Clear;
> IB_wDirect.SQL.Add('insert into test (id, text) values (:pId, :pText)');
> IB_wDirect.Prepare();
> IB_wDirect.Params[0].AsInteger := 1;
> IB_wDirect.Params[1].AsString := 'Hello';
> LOGGER.LOG("LOG: " + IB_wDirect.SQL);
> IB_wDirect.ExecSQL;
> IB_wDirect.Active := false;
>
>
> My problem is, that i'm not able to get the SQL-Statement WITH included
> param values. Is there some way to get an output like that?
>
> LOG: insert into test (id, text) values (1, 'Hello')

I suggest you just loop through the Params by looking at ParamCount and put
in their values from the Params[n].AsString value.

Hope this helps,
Jason LeRoy Wharton
www.ibobjects.com