Subject RE: [IBO] TIB_Query
Author Jason Wharton
> With a TIB_Query I have next statement:
> "Select, from master_table where a.code = 1"
> When I need to perform another select with the same query like
> "Select, from master_table where a.code = 4"
> Is better to close/open with new SQL entry or doing next commands:
> SQL->Clear();
> SQL->Add("Select, from master_table where a.code = 4")
> SQL->Refresh();
> Is better use Params or create the where condition and pass as a
> unique SQL command like example?
> I want to minime overload.

If you are looking to minimize overhead here is what you should do:

MyQuery.SQL.Text := 'select, from master_table where a.code =
MyQuery.ParamByName( 'CODE' ).AsInteger := 1;

<do whatever>

MyQuery.ParamByName( 'CODE' ).AsInteger := 4;

<do some more stuff>


What you had above would force the query to be unprepared when you modified
the SQL property. I have an internal OnChange event that triggers if you
touch this property because if you do then I need to send the statement to
the server again in order to have it be prepared.

Jason Wharton