Accepts any text. The input is not validated against any format — any string is a valid value.
A token that begins with a single quote is treated as a quoted
string. The surrounding quotes are stripped before the value is stored
in Values[]. A literal single quote inside a quoted string
is represented by doubling it.
Input: 'O''Brien' → Values[0]: O'Brien
SQLValues[0]: 'O''Brien'
Unquoted tokens are stored as-is. Leading and trailing whitespace is
preserved unless opTrim is set.
Both , and ; are accepted as list
separators. A comma inside a quoted region is not treated as a
separator.
Input: 'smith, jones' → otSingleValue (comma is inside quotes)
Input: smith, jones → otList (comma is outside quotes)
Input: smith; jones → otList
The range separator (default ~) splits the input into
two bounds. Quoted values on either side of the separator are unquoted
after splitting.
Input: alpha~omega → otRange, Values: ['alpha', 'omega']
Input: 'alpha'~'omega' → otRange, Values: ['alpha', 'omega']
No order check is applied to string ranges.
ERR_INVALID_RANGE is never raised for
itString.
Each token is wrapped in single quotes. Internal single quotes are
doubled (QuotedStr convention).
Values[0]: O'Brien → SQLValues[0]: 'O''Brien'
When SqlOperator is sopContainsAny or
sopContainsAll and the input produces a list, the
individual tokens are collapsed into a single argument rather than
generating IN (…). On ElevateDB the collapsed argument is
passed to the native CONTAINS ANY /
CONTAINS ALL predicate. On all other dialects the words are
joined with % into a LIKE pattern. Empty
tokens (including empty quoted strings '' and tokens that
resolved to NULL via opEmptyStringNull) are
excluded from the collapsed argument. Including them
would introduce double spaces in the ElevateDB argument or
%% in the LIKE pattern, neither of which is meaningful.
Input: "hello;;world" + sopContainsAny, sqlElevateDB
SQLExpression: CONTAINS ANY 'hello world' (empty middle token excluded)
Input: "hello;;world" + sopContainsAny, sqlMySQL
SQLExpression: LIKE '%hello%world%' ESCAPE '\'
Input: "hello;;world" + sopContainsAny, sqlBDEParadox
SQLExpression: LIKE '%hello%world%' (no ESCAPE clause)
ESCAPE '\' is appended for all dialects except
sqlBDEParadox. The BDE SQL layer has unreliable support for
the ESCAPE clause, so it is omitted on that dialect. The
%, _, and \ characters are still
replaced in the pattern to avoid accidental wildcard matches, but
without the ESCAPE clause a literal \ in user
input cannot be represented exactly. SQLValues[] still
reflects the actual token parse result for each position (i.e. the
middle token appears as '' or NULL in
SQLValues[]); only the SQLExpression assembly
ignores empty tokens.
opTrim strips leading and trailing whitespace from each
token value. For itString this is the only way to remove
surrounding spaces; without it they are preserved as part of the
value.
opEmptyStringNull converts empty tokens (including
quoted empty strings '') to NULL in SQL
instead of ''.
opUpperCase and opLowerCase convert token
values to upper or lower case.
Both Values[] and the content inside
SQLValues[] are updated. SQL keywords
(BETWEEN, IN, NULL, etc.) are not
affected. If both flags are set, opUpperCase takes
precedence.
opRequired and opNotNull behave as
described in Parse options.