How to determine which index is Primary

Can someone tell me how to determine which index on a table is the Primary one by reading the meta-schema. Everything else I need is there e.g. _Index-Name, _Unique, _idx-num, etc but I can't for the life of me figure out where to fine the Primary indicator.

Thanks in advance.
 

Rob Fitzpatrick

ProgressTalk.com Sponsor
There are two relations between _File and _Index, and the one you want is where recid( _Index ) = _File._Prime-Index.

So, given a particular table name:

Code:
find _file no-lock where _file._file-name = "mytable".
find _index no-lock where recid( _index ) = _file._prime-index.
message substitute( "&1 is the primary index on &2.", _index._index-name, _file._file-name )
  view-as alert-box.
 
Top