IBCMetadata and index properties

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
troberts
Posts: 9
Joined: Thu 01 Mar 2012 01:51

IBCMetadata and index properties

Post by troberts » Tue 12 Jun 2012 01:09

Hi,

I have some code like this:

IBCMetaData.MetaDataKind := 'Constraints';
IBCMetaData.Filter := 'TABLE_NAME = ''PLATFORM''';
IBCMetaData.Filtered := True;

IBCMetaData.Open;

It gives me the names of indexes in the PLATFORM table. How can I then find out which fields are in each index?

ZEuS
Devart Team
Posts: 240
Joined: Thu 05 Apr 2012 07:32

Re: IBCMetadata and index properties

Post by ZEuS » Tue 12 Jun 2012 11:51

Hekko.

It's better to use the Restrictions property of the TIBCMetadata component instead of the Filter property to limit the list of database objects to be described.
You can set the IBCMetaData.MetadataKind property to 'Indexes' and the TABLE_NAME restriction to 'PLATFORM' to retrieve the list of indexes in the PLATFORM table. Then, you can set the IBCMetaData.MetadataKind property to 'IndexColumns' and the INDEX_NAME restriction to the index name to retrieve the list of columns in the index.

troberts
Posts: 9
Joined: Thu 01 Mar 2012 01:51

Re: IBCMetadata and index properties

Post by troberts » Tue 12 Jun 2012 20:11

Great, thanks very much. That's exactly what I wanted.

Post Reply