Subject Re: [IBO] FieldByName, ParamByName, Performance ???
Author rj@oikossw.de
that will help,
also the "BeginBusy" on the transaction
will save work ...

thanks a lot

Ralph
--- In IBObjects@y..., "Luiz Alves" <cprmlao@i...> wrote:
> Lets upon that:
>
> "tn" is the transaction to ibDSQL
> var ib_col1,ib_col2, ... ib_coln:Tib_Column;
>
> tn.BeginBusy(False);
> ib_col1:= ibDSQL.ParamByName('col1');
> ib_col2:= ibDSQL.ParamByName('col2');
> ....
> ....
> ib_coln:= ibDSQL.ParamByName('coln');
>
> ibDSQL.Prepare;
> while not MemTable.EOF do
> begin
> ib_col1.AsString := MemTableCol1.AsString;
> ...
> ib_col10.AsFloat:= MemTableCol1.AsFloat;
> {Execute}
> ibDSQL.Execute;
> MemTable.Next;
> end;
> tn.EndBusy;
> try
> tn.Commit;
> except
> RollBack;
> end;
>
> Luiz
>
>
> ----- Original Message -----
> From: <rj@o...>
> To: <IBObjects@y...>
> Sent: Monday, March 05, 2001 3:53 PM
> Subject: [IBO] FieldByName, ParamByName, Performance ???
>
>
> > Hi,
> >
> > i am new to IBO and porting an existing
> > and i have got slight performance problems
> > using TIB_DSQL and ParamByName and
> > TIB_Cursor FieldByName
> >
> > using ParamByName my application is about five times
> > slower as if i use Params[idx].
> >
> > the (pseudo) code i am using:
> >
> > ibDSQL := TIB_DSQL.Create(self);
> > ibDSQL.IB_Connection := Connection;
> > ibDSQL.BeginBusy(true);
> > MemTable.DisableControls;
> > MemTable.First;
> > ibDSQL.SQL.Add('insert into tablename ( col1, col2, col3, ...,
> > col10)');
> > ibDSQL.SQL.Add('values (:col1, :col2, ..., :col10)');
> > ibDSQL.Prepare;
> > while not MemTable.EOF do
> > begin
> > ibDSQL.ParamByName('col1').AsString := MemTableCol1.AsString;
> > ...
> > ibDSQL.ParamByName('col10').AsFloat:= MemTableCol1.AsFloat;
> > MemTable.Next;
> > end;
> > ibDSQL.BeginBusy(true);
> > MemTable.GotoBookmark(bm);
> > MemTable.EnableControls;
> >
> > the alternative would be:
> >
> > ibDSQL.Params[0].AsString := MemTableCol1.AsString;
> > ...
> > ibDSQL.Params[9].AsFloat := MemTableCol1.AsFloat;
> >
> >
> > i observe a similar behaviour with TIB_Cursor, TIB_Query and
> > FieldByName. I am a bit suspicious, that I misuse the IBO-Library
> > since the corresponding Method (TIB_Row.GetByName) does not look
> > slow and there is nearly no difference in Runtime between
> > ParamByName and Params[idx] in IBX. By the way: IBO and Params
[idx]
> > is faster :)
> >
> > any tips ?
> >
> > Thanks a lot ...
> >
> > Ralph
> >
> >
> >
> >
> >
> >
> > Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
> >
> >