Hello!
UniDac allows me to get a list of tables and views like so:
SrcConnection.GetTableNames( FSourceNames );
Now I want to fill a list but differentiating between tables and views.
How do I get the properties of a single object?
Please note that the table component does not seem to have anything to distinguish between the two (I did check).
Thanks!
Retrieving properties of tables and views
-
- Posts: 4
- Joined: Sat 20 Apr 2019 13:52
Re: Retrieving properties of tables and views
Unfortunately, the GetTableNames method cannot return the View list. To get the metainfo of the database objects from the server, you can use the TUniMetaData component.
The following is an example of how you can get the View list:
The following is an example of how you can get the View list:
Code: Select all
UniMetaData1.MetaDataKind := 'Tables';
UniMetaData1.Restrictions.Values['TABLE_TYPE']:= 'VIEW';
UniMetaData1.Open;
while not UniMetaData1.Eof do
begin
Memo1.Lines.Add(UniMetaData1.FieldByName('TABLE_NAME').AsString);
UniMetaData1.Next;
end;