Subject Re: [IBO] Data Pump: More efficient way?
Author Anthony Ison
In an earlier post, the following was presented as a good way of doing a
data pump. Just wondering, what is the purpose of the "if not Prepared
then Prepare;"? The call to parambyname should automatically do this
for you. The only time I call prepare is if I am going to use something
like "params[0].AsSomeType := fields[0].AsSomeType". I used to use this
for speed before upgrading to IBO 4.0... So I guess my question is
two-fold. Is there a reason to call Prepare? And is there any benefit
to using the params[i] vs parambyname any more?

Thanks in advance.
Anthony

> This way, you can do this in [BeforeExecute]
> with MyDSQL do
> begin
> if not Prepared then Prepare;
> ParamByName('Col1').AsSomeType := AdoQuery1.Acolumn.AsSomeType;
> ParamByName('Col2').AsSomeOtherType :=
AdoQuery1.Acolumn.AsSomeOtherType;
> ....
>
> end;

"Always do right - this will gratify some and astonish the rest."