Subject | Re: [IBO] Iterate through tables and fields |
---|---|
Author | Lucas Franzen |
Post date | 2004-07-11T09:22:48Z |
ra8009 schrieb:
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.
> I want to iterate through all of the tables in my database and forThe TIB_Connection has a SchemaCache property which will provide you the
> each one iterate through the fields. How can I aaccomplish this with
> IB Objects?
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.