Subject | faster Parameter passing to stored Procedures. |
---|---|
Author | Andrew |
Post date | 2006-12-04T15:08:06Z |
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
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