Special characters, case sensitivity, and comments in ESQL

When you work with ESQL, it is useful to know about the special characters that are available, whether ESQL syntax is case sensitive, and how to handle comments.

Special characters

Symbol Name Usage
; semicolon End of ESQL statement
. period Field reference separator or decimal point
= equals Comparison or assignment
> greater than Comparison
< less than Comparison
[] square brackets Array subscript
' single quotation mark Delimit string, date-time, and decimal literals

Note, that to escape a single quotation mark inside a string literal, you must use two single quotation marks.

|| double vertical bar Concatenation
() parentheses Expression delimiter
" quotation mark Identifier delimiter
* asterisk Any name or multiply
+ plus Arithmetic add
- minus Arithmetic subtract, date separator, or negation
/ forward slash Arithmetic divide
_ underscore LIKE single wildcard
% percent LIKE multiple wildcard
\ backslash LIKE escape character
: colon Name space and Time literal separator
, comma List separator
<> less than greater than Not equals
-- double minus ESQL single line comment
/* */ slash asterisk asterisk slash ESQL multiline comment
? question mark Substitution variable in PASSTHRU
<= less than or equal Comparison
>= greater than or equal Comparison
/*!{ }!*/ executable comment Bypass tools check

Case sensitivity of ESQL syntax

The case of ESQL statements is:
  • Case sensitive in field reference literals
  • Not case sensitive in ESQL language words

Comments

ESQL has two types of comment: single line and multiple line. A single line comment starts with the characters -- and ends at the end of the line.

In arithmetic expressions you must take care not to initiate a line comment accidentally. For example, consider the expression:
1 - -2
Removing all white space from the expression results in:
1--2

which is interpreted as the number 1, followed by a line comment.

A multiple line comment starts with /* anywhere in ESQL and ends with */.