Subject IBX correction #1
Author murasr1.eti@mail.cez.cz
Dominant faktor for program efectivity (available CPU time) are cycles (For...,
Repeat... While...).

In IBSQL Unit in object TIBXSQLVAR is set of procedures which is responsible
for seting columns .
(Each procedure for certain data type)
One of this procedures is calling for each column of each row.

Each procedure has the same design and in the each of this procedures is "For"
cycle
which is responsible for location column in TIBXSQLDA object :

Procedure TIBXSQLVAR.SetAs...(Value: ...);
Var
....
Begin
...
for i := 0 to FParent.FCount - 1 do
if FParent.FNames[i] = FName then
begin
...
specific statements - depending on DataType
...
end;
End;.


This For cycle is (as you see) fully unreasonably drafted to the end.

The correction of this situation is very simple - inserts Break statement
before end of For cycle :

procedure TIBXSQLVAR.SetAsLong(Value: Long);
var
i: Integer;
xvar: TIBXSQLVAR;
begin
if IsNullable then
IsNull := False;
for i := 0 to FParent.FCount - 1 do
if FParent.FNames[i] = FName then
begin
xvar := FParent[i];
xvar.FXSQLVAR^.sqltype := SQL_LONG or (xvar.FXSQLVAR^.sqltype and 1);
xvar.FXSQLVAR^.sqllen := SizeOf(Long);
xvar.FXSQLVAR^.sqlscale := 0;
IBAlloc(xvar.FXSQLVAR^.sqldata, 0, xvar.FXSQLVAR^.sqllen);
PLong(xvar.FXSQLVAR^.sqldata)^ := Value;
xvar.FModified := True;
Break // FName is located next loop is
needless.
end;
end;

This inaccurateness I found in FIBComponents and in FIBPlus components too
and maybe it has/had some historic rootage.(?)

The attachement contains unit after correction all of this procedures.

I have been using this corrections in FIBComponents in many programs more then
one year.

cheers

Muras R.

(See attached file: IBSQL.pas)


[Non-text portions of this message have been removed]