Subject Re: [IBO] Big Batch...
Author Luiz Alves
As Geoff shows, you need Prepare dsql one time and make a statical reference
to the parameters.

So, this lines are very importants:

dsql.Prepare;
tmpCol := dsql.ParamByName( 'SYMBOL' ); {here you create a reference to
the "SYMBOL' parameter and it saves time when using this parameter later.}

The use of BeginBusy and EndBusy methods of the transaction also can help
to speed up.

Luiz.

----- Original Message -----
From: Admin <dkeith@...>
To: <IBObjects@yahoogroups.com>
Sent: Friday, March 16, 2001 11:44 PM
Subject: Re: [IBO] Big Batch...


> Geoff, Jason -
>
> I reviewed and ran the Blobinsert sample project. Didn't fully
> understand all that you were recommending to do, but I got the message
> loud and clear about using parameters. So I changed the code to work
> like this:
>
> dsql.SQL.Text := 'INSERT INTO SYMBOLS (SYMBOL) VALUES (:p)';
> for i := 1 to tsl2.Count do
> begin
> p := pchar(tsl2.Strings[i-1]);
> dsql.ExecSQL ;
> end;
>
> and that brought the time down to 39-42 seconds. Big improvement. Don't
> quite understand why you emphasize creating a column reference, but I'll
> try to figure it out and see if it improves the time even more.
>
>
> So something
> > like...
> >
> > var
> > tmpCol: TIB_Column;
> > i: integer;
> > begin
> > dsql.SQL.Text := 'INSERT INTO SYMBOLS (SYMBOL)' +
> > ' VALUES (:SYMBOL)';
> > dsql.Prepare;
> > tmpCol := dsql.ParamByName( 'SYMBOL' );
> > for i := 0 to tsl1.Count - 1 do
> > begin
> > tmpCol.AsString := tsl2.Strings[i];
> > dsql.ExecSQL;
> > // make the app responsive during long processing
> > if (i mod 1000) = 0 then
> > Application.ProcessMessages;
> > end;
> > end;
> >
> > Remember to use tmpCol.Clear if you want to insert a NULL value as IBO
> > will not clear parameters between calls to ExecSQL.
>
> > The IB6 client has a bug and will not support multiple threads at this
> > time. (And besides which, even in IB5, you need to follow the
> > directions for multiple threading in IBO - see the sample
> > applications.)
>
> That's good to know, obviously not IBO's fault as a product, but
> disappointing in this day and age when a database product has to compete
> with the likes of Oracle. I thought the only threading implication with
> using IB was the 1 processor limit.
>
> Any chance this will be changed(fixed?) in your firebird version?
>
> Thanks again.
>
> DK
>
> [Non-text portions of this message have been removed]
>
>
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>