Subject | Re: [IBO] Data Pump: More efficient way? |
---|---|
Author | Helen Borrie |
Post date | 2004-09-07T00:09:58Z |
At 09:25 AM 7/09/2004 +1000, you wrote:
ParamByName. I always include a conditional call to Prepare for
non-dataset components. It doesn't eat anything and it avoids unexpected
GPLs from code referencing unprepared params.
when calling Execute and after the SQL property is invalidated, yes (IMO).
would continue to stress the need to call a conditional Prepare whenever
you are about to reference Params[].
Helen
>In an earlier post, the following was presented as a good way of doing aFor the dataset components, the conditional Prepare is called by
>data pump. Just wondering, what is the purpose of the "if not Prepared
>then Prepare;"?
ParamByName. I always include a conditional call to Prepare for
non-dataset components. It doesn't eat anything and it avoids unexpected
GPLs from code referencing unprepared params.
>The call to parambyname should automatically do this for you.As it does.
> The only time I call prepare is if I am going to use somethingCorrect. But the Prepare call should be conditional.
>like "params[0].AsSomeType := fields[0].AsSomeType".
> I used to use this for speed before upgrading to IBO 4.0... So I guessIf you are referencing Params[] directly then yes. As a harmless safeguard
> my question is two-fold. Is there a reason to call Prepare?
when calling Execute and after the SQL property is invalidated, yes (IMO).
>And is there any benefit to using the params[i] vs parambyname any more?Certainly is. It's a much less costly method than ParamByName. And I
would continue to stress the need to call a conditional Prepare whenever
you are about to reference Params[].
Helen