Converting From IBX - Index Management

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
SeaCay
Posts: 26
Joined: Wed 10 Jan 2007 03:03

Converting From IBX - Index Management

Post by SeaCay » Sun 17 Jun 2007 04:09

I am reasonably new to IBDAC and am currently converting one BDS2006 project from IBX to IBDAC

One problem I have hit quite early on is Index Management.

With IBX I can use the three lines
  • 1) aTable.IndexDefs.Update;
    2) aTable.GetInsexNames{aStringList);
    3) with aTable.INdexDefs.AddIndexDef
    • Name := 'SOME_INDEX_NAME');
      Fields := 'FIELD_ONE;FIELD_FOUR;FIELD_NINE';
      Options = [ixUnique, ixDescending];
    end;
What are the equivalent statements for IBDAC?

regards and thanks

SeaCay

Alex
Posts: 655
Joined: Mon 08 Nov 2004 08:39

Post by Alex » Mon 18 Jun 2007 15:27

The TIBCTable component provides limited compatibility with BDE and IBX table components.
The limitations include not supporting any table structure modification including Table creation, Index modification and other.
We will consider adding possibility of reading IndexDefs from server in one of the next IBDAC builds.
Now you should use special SQL query to obtain such information. For example:

Code: Select all

    Select I.RDB$INDEX_NAME, I.RDB$UNIQUE_FLAG,
    I.RDB$INDEX_TYPE, I.RDB$SEGMENT_COUNT, S.RDB$FIELD_NAME from RDB$INDICES I,
    RDB$INDEX_SEGMENTS S where I.RDB$INDEX_NAME = S.RDB$INDEX_NAME
    and I.RDB$RELATION_NAME = 'THE_NAME_OF_THE_TABLE'
where THE_NAME_OF_THE_TABLE is your table name. You can run this query with TIBCQuery, and
analyze retrieved data.

SeaCay
Posts: 26
Joined: Wed 10 Jan 2007 03:03

Post by SeaCay » Mon 18 Jun 2007 22:34

Thanks for the reply, I will follow your advice.

Post Reply