FIELDCHECKUNIQUE()

From Lianjapedia
Jump to: navigation, search

Purpose

Function to check if the specified field has the checkunique column constraint

Syntax

FIELDCHECKUNIQUE(<workarea>|<alias>,<cField>)

See Also

ADESC(), AFIELDS(), ALTER TABLE, ASTORE(), ASTRING(), Checkunique Column Constraint, Constraints, CREATE TABLE, DBF(), FIELD(), FIELDCALCULATED(), FIELDCHOICES(), FIELDINFO(), FIELDNAME(), FIELDRECALCULATE(), FILTER(), FLDCOUNT(), FLDLIST(), GETDATAMAPPING(), INDEXKEY(), KEYLOOKUP(), LABEL(), LIST DICTIONARY, NDX(), RTOS(), SETDATAMAPPING()

Description

The FIELDCHECKUNIQUE() function is used to check whether the checkunique column constraint is set for the specified field <cField> from the table open in the specified workarea/cursor number or with the specified alias name.

From v9.8.4.

Example

open database southwind
alter table example modify constraint account_no set checkunique
alter table example modify constraint limit recalculate
alter table example modify constraint balance recalculate
alter table example modify constraint available calculated limit - balance
use example
? fieldcheckunique("example","account_no")
.T.
? fieldrecalculate("example","limit")
.T.
? fieldcalculated("example","available")
limit - balance
use
use example in 3
? fieldcheckunique(3,"account_no")
.T.
? fieldrecalculate(3,"balance")
.T.
? fieldcalculated(3,"available")
limit - balance