Kbase 17930: CONTAINS cannot search for record with ampersand (" & ")
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  5/14/1998 |
|
CONTAINS cannot search for record with ampersand (" & ")
The CONTAINS keyword cannot be used when doing a word index search
on a field that has the ampersand character ("&") in it.
For example, the following code will generate error 2876 at runtime:
FOR EACH customer WHERE customer.comments CONTAINS "&":
DISPLAY name comments.
END.
This is due to the fact that the ampersand is interpreted only as a
logical operator (signifying "AND"). There is no escape character
that can be used to force the ampersand to be interpreted literally.
It is a delimiter, much as a space is a delimiter.
Furthermore, the word index does not index the "&" character, so even
if the syntax did not trigger the error, the record(s) with the
ampersand would not be found. (In the same manner, spaces also are
not indexed and would not be found if searching for them.)