CONSTRAINTS ( Collection of CONSTRAINTs )

Represents a constraint expression used to validate input or derived values within an AiSQL rule or model.

Properties of CONSTRAINT

NameTypeDescription
TargetenumCONSTRAINTTargetsSpecifies whether the constraint applies to input values or derived data.
FieldSTRINGThe field or feature name being evaluated by the constraint.
OperatorenumOperatorThe comparison operator used to evaluate the constraint.
ValueAISQLEXPRESSIONThe value or expression against which the field is evaluated.
ActionenumConstraintActionsThe action executed when the constraint evaluation fails.

Syntax

	
CONSTRAINTS 
            <Target> <Field> <Operator> <Value> [ON_FAIL <Action>]

Examples

	
MODULE
    MODEL
        CONSTRAINTS 
                INPUT_TARGET Age > 18

	
MODULE
    MODEL
        CONSTRAINTS 
                DATA_TARGET RiskScore >= 0.75 ON_FAIL REJECT