Consultor Eletrônico



Kbase 17934: CONTAINS cannot search for record with parenthesis ( )
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   5/15/1998
CONTAINS cannot search for record with parenthesis ( )

The CONTAINS keyword cannot be used when doing a word index search
on a field that has a parenthesis "(" or ")" in it.

For example, the following code will generate a runtime error:

FOR EACH customer WHERE customer.comments contains ")":
DISPLAY name comments.
END.

This is because the parenthesis is used as a logical delimiter in
grouping strings and operators. There is no escape character that
can be used to force the parenthesis to be interpreted literally.
By being treated this way, the word index is handling the parenthesis
much the same way as a space.

Furthermore, the word index does not index the "(" or ")" characters
when they appear in character fields. So, even if the syntax above
did not generate an error, the record(s) containing the parentheses
would not be found. (This is how spaces are treated as well.)