Language basics / Variables |
The VALIDATE instructions checks a variable value according to schema validation rules.
VALIDATE target [,...] LIKE { table.* | table.column }
The VALIDATE statement tests whether the value of the specified variable is within the range of values for a corresponding column in .val database schema file referenced by a SCHEMA clause. If the value does not match any value defined in the INCLUDE attribute of the corresponding column, the runtime system raises error -1321.
The argument of the VALIDATE instruction can be a simple variable, a record, or an array element. If the target is a record, you can use the dot + star notation to reference all record members in the validation, or specify a range of record members with the THRU clause.
SCHEMA stores MAIN DEFINE cname LIKE customer.cust_name LET cname = "aaa" VALIDATE cname LIKE customer.cust_name END MAIN