[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'DB' (#fcl)

# TCheckConstraint

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Record-level constraint definition

## Declaration

Source position: db.pas line 1084

`type TCheckConstraint = class(TCollectionItem)`
`public`
`procedure Assign(); override;` |  | Assign one constraint to another
`published`
`property CustomConstraint: string; [rw]` |  | User-defined constraint
`property ErrorMessage: string; [rw]` |  | Message to display when the constraint is violated
`property FromDictionary: Boolean; [rw]` |  | True if the constraint is imported from a datadictionary
`property ImportedConstraint: string; [rw]` |  | Constraint imported from the database engine
`end;`

## Inheritance

`TCheckConstraint` |  | Record-level constraint definition
`TCollectionItem`
`TPersistent,IFPObserved`
`TObject`

## Description

TCheckConstraint can be used to store the definition of a record-level constraint. It does not enforce the constraint, it only stores the constraint's definition. The constraint can come from several sources: an imported constraints from the database, usually stored in the TCheckConstraint.ImportedConstraint property , or a constraint enforced by the user on a particular dataset instance stored in TCheckConstraint.CustomConstraint

## See also

TCheckConstraints |  | Set of record-level constraints
TCheckConstraint.ImportedConstraint |  | Constraint imported from the database engine
TCheckConstraint.CustomConstraint |  | User-defined constraint