Subject Re: [IBO] TIB_Query buffering
Author Svein Erling Tysvær
Hi George,
always glad to see people with Norwegian email addresses join this list.

>1. Rather than using my own array, is it possible to walk (not edit) a
>TIB_Query in the same fashion at a decent speed?

Yes, it should be unless you have an extremely fast definition of decent
speed. 100 records really isn't much and traversing those could take less
than a second if you do things sensibly, doesn't do comparisons on blobs
and have no network issues (I once wrote a utility which we use to transfer
data from one database to another and using TIB_Cursors I think it can
transfer about 4000 records a second when run on the server if the table
doesn't contain too many columns).

Simply define a variable of type MyColumn: TIB_Column; do a
MyColumn:=My_Query.FieldByName('MyFieldName'); before the loop and then use
MyColumn.AsInteger or whatever within your loop. Simple and fast. Avoid
using FieldByName directly within the loop, because it then has to find the
field every time you reference it and this decrease performance
significantly (but I'm not certain 100 records is enough for you to notice).

Using cached updates may be an overkill for your needs. As for posting
several times and do things on the server at the end, just try posting
every time and commit your transaction at the end. Choose the more
complicated approaches only when the simple things prove to not work
satisfactorily. It is amazing how much you can do with IBO without
complicating things.

HTH,
Set (Svein Erling)