Subject | Re: [IBO] Slow FieldByName |
---|---|
Author | Svein Erling Tysvaer |
Post date | 2002-08-20T10:47:54Z |
Hi Helton, just translating Jasons reply into code:
var
MyField: TIB_Column;
begin
MyCursor.Prepare;
MyField:=MyCursor.FieldByName('SomeFieldName'); //Use only FieldByName once.
MyCursor.First;
while not MyCursor.Eof do begin
<something>:=MyField.AsString; //or AsInteger, AsBoolean etc.
...
MyCursor.Next;
end;
MyCursor.Close;
end;
HTH,
Set
At 12:20 19.08.2002 -0700, you wrote:
var
MyField: TIB_Column;
begin
MyCursor.Prepare;
MyField:=MyCursor.FieldByName('SomeFieldName'); //Use only FieldByName once.
MyCursor.First;
while not MyCursor.Eof do begin
<something>:=MyField.AsString; //or AsInteger, AsBoolean etc.
...
MyCursor.Next;
end;
MyCursor.Close;
end;
HTH,
Set
At 12:20 19.08.2002 -0700, you wrote:
>What I recommend people always do if possible is to do FieldByName outside
>of the loop and store aside the direct object reference in a local variable
>and make reference to it directly instead.