Hi,
I'm trying to retrieve the column names of a specified table from a Firebird 2.0.4 database (embedded) using UniDAC 1.2 under D2007. The code I write is:
LMetaData := TUniMetaData(IConnection.CreateMetaData);
try
LMetaData.MetaDataKind := 'Columns';
LMetaData.Restrictions.Values['TABLE_NAME'] := TableName;
LMetaData.Open;
LMetaData.GetMetaDataKinds(AList);
finally
LMetaData.Free;
end;
... however, the result in AList is not the column names from the table but instead the list is filled with all available MetaDataKind restrictions (Columns, Constraints, IndexColumns, ... ). Am I doing something wrong or is this a bug?
Many thanks in advance for your help.
Best regards,
/T
Retrieving table column names using the Firebird provider
The GetMetaDataKinds procedure returns metadata kinds that are supported by TUniMetaData.
To get the column names, you can use the TUniMetaData component like TUniQuery:
To get the column names, you can use the TUniMetaData component like TUniQuery:
Code: Select all
LMetaData.Open;
while not LMetaData.Eof do begin
ColName := LMetaData.FieldByName('COLUMN_NAME').AsString;
LMetaData.Next;
end;