xHarbour Reference Documentation > Command Reference |
Includes or excludes non-unique keys to/from an index.
SET UNIQUE on | OFF | ( <lOnOff> )
The SET UNIQUE command determines how many records of a database, that result in the very same index value, are included in an index. With SET UNIQUE OFF, all records are included. When the setting is ON, a record is only included in an index when the index value of the record does not exist in the index. That is, an index value exists only once in an index.
SET UNIQE is a global setting valid for all work areas. It can be overridden for individual work areas with the UNIQUE option of the INDEX command.
Note: It is important to understand that the SET UNIQUE setting affects indexes, not databases. It is possible to add, for example, the name "Miller" ten times to an address database. When the database is indexed on "LASTNAME" and SET UNIQUE is ON, only the first record containing "Miller" is added to the index. If this index is later selected as the controlling index, the remaining nine "Miller" records are not visible.
See also: | DbCreateIndex(), INDEX, OrdCreate(), PACK, REINDEX, SEEK, Set() |
Category: | Index commands , SET commands |
Source: | rdd\dbcmd.c, rtl\set.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
http://www.xHarbour.com