15. VIFRED Field Specifications : Specify a Validation Check : Comparison Operator Validation Checks : Comparison to a List of Values
Share this page                  
Comparison to a List of Values
By using the keyword in, you can compare a value against an arbitrary list of values using the following format:
fieldname in [list]
The fieldname parameter is the internal name of the field and list is the list of valid values. The values in list must be of the same data type as values admissible in the field. They must be separated by commas and enclosed in brackets ([ ]).
If the field has a character data type, you must enclose the character string values in double quotation marks and you can use valid pattern‑matching characters. Leading blanks are not significant.
The following example requires that the name entered in the Lname field be either Jones, or Ortega, or Bridges:
lname in ["Jones", "Ortega", "Bridges"]
This example requires that the character string entered in the Address field contain the characters Bl, or Av, or end in R plus one other letter, or end with St:
address in ["*Bl*", "*Av*", "*R?", "*St"]
This example requires that the amount entered in the Salary column of the Emptable table field be either 1000, 1100, 1200, 1300, 1400, or 1500:
emptable.salary in [1000, 1100, 1200, 1300, 1400, 1500]