Subject | RE: [IBO] faster Parameter passing to stored Procedures. |
---|---|
Author | Jason Wharton |
Post date | 2006-12-05T01:55:03Z |
Using the variant type may not be the fastest.
Consider a case statement testing the type of data and then use a more
native type of operator like AsString.
Another thing you can do, that I do in the TIB_DataPump for you is I
actually bind the input parameters to the output parameters so that there is
absolutely no transfer of data. They both bind to the same internal
buffers. If your situation will allow that I can show you how this can be
done if you send me a sample app that I can easily modify. I will have you
pay a minor support instance to do this if you feel I have improved your
performance significantly enough. Also, this cannot be done with ARRAY and
BLOB ID's.
Consider a case statement testing the type of data and then use a more
native type of operator like AsString.
Another thing you can do, that I do in the TIB_DataPump for you is I
actually bind the input parameters to the output parameters so that there is
absolutely no transfer of data. They both bind to the same internal
buffers. If your situation will allow that I can show you how this can be
done if you send me a sample app that I can easily modify. I will have you
pay a minor support instance to do this if you feel I have improved your
performance significantly enough. Also, this cannot be done with ARRAY and
BLOB ID's.
> -----Original Message-----
> From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com]On
> Behalf Of Andrew
> Sent: Monday, December 04, 2006 8:08 AM
> To: IBObjects@yahoogroups.com
> Subject: [IBO] faster Parameter passing to stored Procedures.
>
>
> Hi,
>
> I have an application which takes data from an IB_Query and passes
> this data as parameters into a prepared stored procedure.
>
> At the beginning of the procedure i have a start transaction and this
> is committed at the end of the procedure. there is generally upto
> 3000 records per transaction. Within a loop in the procedure I have:
>
> SP is a element of an array of IB_StoredProc all of which reference
> different tables and all of which have previously been prepared.
>
>
> if not SP.Prepared then SP.Prepare;
> for iI := 0 to q.FieldCount -1 do
> SP.Params[iParam].AsVariant := q.Filds[iI].AsVariant ;
> try
> SP.ExecSQL;
> except
> //Handle failure here.
> end ;
>
>
> This works fine, however with some of the tables (300 fields+) this
> appears a little slow and I was hoping to be able to speed up this
> process, Reducing table size is not currently an option but will be
> carried out in a forthcoming system re-write.
>
> Any suggestions please?
>
> Andrew
>
>
>
> ______________________________________________________________
> _____________
> IB Objects - direct, complete, custom connectivity to
> Firebird or InterBase
> without the need for BDE, ODBC or any other layer.
> ______________________________________________________________
> _____________
> http://www.ibobjects.com - your IBO community resource for
> Tech Info papers,
> keyword-searchable FAQ, community code contributions and more
> !
> Yahoo! Groups Links
>
>
>
>