Subject Most Efficient Param Setting
Author Kevin Stanton
Greetings,
I was just curious, what is the best/most efficient/fastest way to do Param
setting w/ TIB_Cursor?

I have a main query I have to step through and use it's data elements to use
as params for a subquery but only 3 of the 5 params for the subquery change
on each iteration:

Is the following correct or do I need to use the beginbusy stuff? If so
what would the correct syntax be?

with qryMain. do
begin
First;
While NOT EOF do
begin
if qryOrdDtlC.Prepared = False then // <---Detail/SubQuery
begin
qryOrdDtlC.Prepare;
qryOrdDtlC.ParamByName('Company').AsString := CurrCoNo; //
<---These don't change
qryOrdDtlC.ParamByName('Division').AsString := CurrDiv; //
<---for each iteration
end;

// the following 3 params change each loop.
qryOrdDtlC.ParamByName('OrderNo').AsString :=
FieldByName('OrderNo').AsString;
qryOrdDtlC.ParamByName('Suffix').AsString :=
FieldByName('Suffix').AsString;
qryOrdDtlC.ParamByName('ProdID').AsString :=
FieldByName('ProdID').AsString;

If NOT qryOrdDtlC.Active then qryOrdDtlC.Open Else qryOrdDtlC.Refresh;

{ More Processing here }

Next;
end;
end;



TIA,
Kevin