|Subject||RE: [IBO] TIB_Query|
> With a TIB_Query I have next statement:If you are looking to minimize overhead here is what you should do:
> "Select a.id, a.name from master_table where a.code = 1"
> When I need to perform another select with the same query like
> "Select a.id, a.name from master_table where a.code = 4"
> Is better to close/open with new SQL entry or doing next commands:
> SQL->Add("Select a.id, a.name from master_table where a.code = 4")
> Is better use Params or create the where condition and pass as a
> unique SQL command like example?
> I want to minime overload.
MyQuery.SQL.Text := 'select a.id, a.name from master_table where a.code =
MyQuery.ParamByName( 'CODE' ).AsInteger := 1;
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.