Is there a way to get detailed info for an index during runt

Posted by Rom Elwell on 16-Nov-2012 11:58

We are working on creating a class that will create dynamic ProDataSets (dynPDS) on demand for our application.  With respect to creating the DATA-RELATIONs between the parent buffer and child(ren), I am investigating if there is a way to glean the key field(s) for the underlying data table associated with a buffer (temp-table) in the dynPDS.

If I call INDEX-INFORMATION for the parent buffer of the dynPDS, I can determine the name of the index being used by the query object associated with this buffer.  Is it possible, using the name of the index, to find the key field(s) associated with this index at runtime?

All Replies

Posted by Rom Elwell on 16-Nov-2012 12:16

It appears I am confusing two uniquely different topics:  Indices and Keys.

Having reviewed the short thread here:  http://communities.progress.com/pcom/message/29276#29276, I am concerned that while I can find the primary index, it is not required that this index be defined as 'unique'.  Irregardless, I would still like to know if it is possible to decompose an index at runtime to expose the elements that comprise the index...

Posted by Matt Baker on 16-Nov-2012 20:56

Yes.  The database has tables that have the metaschema.   You can read index information from the _index table in the databasse.  The field names from the index are also available.

Posted by Peter Judge on 19-Nov-2012 10:35

romelwell wrote:

It appears I am confusing two uniquely different topics:  Indices and Keys.

Having reviewed the short thread here:  http://communities.progress.com/pcom/message/29276#29276, I am concerned that while I can find the primary index, it is not required that this index be defined as 'unique'.  Irregardless, I would still like to know if it is possible to decompose an index at runtime to expose the elements that comprise the index...

The INDEX-INFORAMTION method on a buffer handle should give you what you want.

From the help it returns a string that's formatted as follows:




hth,

-- peter

This thread is closed