Selection string rules and restrictions
Familiarize yourself with these rules about how selection strings are interpreted and character restrictions to avoid potential problems when using selectors.
- Message selection for publish/subscribe messaging occurs on the message as sent by the publisher. See Selection strings.
- Equivalence is tested using a single equals character; for example,
a = bis correct, whereasa == bis incorrect. - An operator used by many programming languages to represent 'not equal to' is
!=. This representation is not a valid synonym for<>; for example,a <> bis valid, whereasa != bis not valid. - Single quotation marks are recognized only if the ' (U+0027) character is used. Similarly, double quotation marks, valid only when used to enclose byte strings, must use the " (U+0022) character.
- The symbols
&,&&,|and||are not synonyms for logical conjunction/disjunction; for example,a && bmust be specified asa AND b. - The wildcard characters
*and?are not synonyms for%and_. - Selectors containing compound expressions such as
20 < b < 30are not valid. The parser evaluates operators that have the same precedence from left to right. The example would therefore become(20 < b) < 30, which does not make sense. Instead the expression must be written as(b > 20) AND (b < 30). - Byte strings must be enclosed in double quotation marks; if single quotation marks are used, the byte string is taken to be a string literal. The number of characters (not the number that the characters represent) following the
0xmust be a multiple of two. - The keyword
ISis not a synonym for the equals character. Thus the selection stringsa IS 3andb IS 'red'are not valid. TheISkeyword exists only to supportIS NULLandIS NOT NULLcases.