Find out index flags

dunno

New Member
Hello
At first, sorry for my bad english. I hope you understand what I mean.

Is it possible to find out the index flags (e.g. unique, primary unique, nothing)?
For "unique" ich take the database._index._unique field (_index is a system table).
Example:
Code:
FOR EACH databasename._file
  WHERE databasename._file._file-name = "Example"
NO-LOCK:
  FOR EACH databasename._index OF databasename._file
    WHERE databasename._index._index-name = "Test"
  NO-LOCK:
    IF databasename._index._unique THEN DO:                    
    MESSAGE "Index Test in table Example is unique"
      VIEW-AS ALERT-BOX INFO BUTTONS OK.
    END.
  END.
END.
If I want to now, if the index "Test" in table "Example" is unique.
Is it also possible to find out if the index is the primary-key?

Sorry again, for my english :blush:

greetz dunno
 
Yes, your example correctly identifies the index as unique.

The primary index is the _index where recid( _Index ) = _File._Primary-Index.
 
Back
Top