Kbase P105311: How to programmatically find the primary index of a particular table?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/4/2005 |
|
Status: Verified
GOAL:
How to programmatically find the primary index of a particular table?
GOAL:
How to create a primary index report for all non-hidden tables in a Progress Database using the 4GL?
GOAL:
How to query the metaschema for primary index information using the 4GL?
FACT(s) (Environment):
Progress 8.x
Progress 9.x
OpenEdge 10.x
FIX:
Sometimes one might want to programmatically find out the primary index of a particular table. The following sample program shows how to create a primary index report for all non-hidden tables in a database:
OUTPUT TO VALUE("primIdxRpt.txt":U).
FOR EACH _file WHERE _file._file-number > 0 NO-LOCK,
FIRST _index WHERE RECID(_index) = _file._prime-index NO-LOCK:
DISPLAY _file._file-name _index._index-name LABEL "Primary Index" WITH DOWN.
END.
OUTPUT CLOSE.