Subject Re: [IBO] Re: Correct Way to Use TIB_StoredProc
Author Helen Borrie
At 09:32 PM 19/04/2003 +0000, you wrote:
> >it's actually more efficient to use TIB_DSQL and TIB_Query for
>executable and selectable stored procedures, respectively
>I am playing with a remote Linux server accessed via a slow TCP/IP
>The first thing I noted was how slow is the Prepare method of a
>Now I understand that I should use a TIB_DSQL.
> > With any of the components, the Params[] array gets cleared
>whenever the component is unprepared. Unprepare occurs whenever you
>change the SQL property or, in the case of TIB_StoredProc, the
>What if I want to use the same SP with new parameters ?

No, this does not change the structure of the SQL and so a prepare is not
necessary (and should not be allowed by your code, if you care about

>The following code works:
>But it is rather slow.
>Is there any faster way to feed new parameters to a SP ?

Yes. Keep it prepared. Your code should be:

if not Prepared then Prepare; <-- only needs to be done once

For batches, you will also make it faster if you place batches of up to
2000 calls to the procedure inside a single, explicit transaction.