Try OpenEdge Now
skip to main content
Programming Interfaces
Data Management : Database Access : The CONTAINS operator : Writing queries using the CONTAINS operator : Syntax of the CONTAINS operator of the WHERE option
Syntax of the CONTAINS operator of the WHERE option
The CONTAINS operator has the following syntax in the WHERE option of the record phrase:


WHERE field CONTAINS string-expression
A field or array of type CHARACTER that participates in a word index.
An expression of type CHARACTER that represents possible contents of field. The syntax of stringexpression is as follows:
"word[[ & | | | ! | ^ ] word ]..."
The word to search for.
The ampersand (&) represents logical AND, while the vertical bar (|), the exclamation point (!), and the caret (^) represent logical OR. AND limits your search to records that contain all words you specify, while OR enlarges your search to include any word you specify. You can combine ANDs and ORs within stringexpression. You can also group items with parentheses to create complex search conditions.
You can use a wild card on the end of a string. For example, the string "sales*" represents "sales," "saleswoman," "salesman," "salesperson," and similar strings.
You can also define a character variable and assign a value to that variable.