Subject Re: [IBO] Iterate through tables and fields
Author Lucas Franzen
ra8009 schrieb:
> I want to iterate through all of the tables in my database and for
> each one iterate through the fields. How can I aaccomplish this with
> IB Objects?

The TIB_Connection has a SchemaCache property which will provide you the
information you need.

You can get the tables by assigning a StringList to the
SchemaCache.TableNames property.
The table fields you'll get with the SchemaCache.GetTableFields method.

Example:

procedure GetAllTablesAndFields;
var
tl: TStringList;
fl: TStringList;
ii: Integer;
jj: Integer;
begin
tl := TStringList.Create;
fl := TStringList.Create;

tl.Assign ( IB_Connection.SchemaCache.TableNames );

// iterate through the tables
for ii := 0 to tl.Count - 1 do
begin
// get the fields for the "current" table
IB_Connection.SchemaCache.GetTableNames ( tl[ii], fl );
...
end

Luc.