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?
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...
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.
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:
Three integer values
of value 0 (FALSE) or 1 (TRUE) depending on whether the index is unique,
primary or a word index
hth,
-- peter