Kbase 19435: How-To: Programatically find the Primary Index w/metaschema
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  21/01/2000 |
|
KnowledgeBase Number: 19435
Creation Date: 20-JAN-00
Modified Date:
This document applies to: Progress Metaschema Tables
Version and Release Number: Version 6 and higher
Summary: Sometimes Customers might want to programatically find out
the primary index of a particular table. The following program shows
how to create a primary index report for all non-hidden tables in a
-V8 database(For V9 and higher, add the following to the filter for _file: AND _tbl-type = "T").
Step by Step Details:
OUTPUT TO primIndex.txt.
FOR EACH _file WHERE _file._file-number > 0 NO-LOCK:
FIND _index WHERE RECID(_index) = _file._prime-index
NO-LOCK NO-ERROR.
IF AVAILABLE(_index) THEN
DISPLAY _file._file-name _index._index-name LABEL
"Primary Index" WITH DOWN.
END.
OUTPUT CLOSE.