Scalar Literals
Scalar literals are used to represent constant values in expressions and search conditions within an SQL command or query. With some data types, the literal has to be preceded by the appropriate keyword (such as INTERVAL
in the expr-primary-interval expression). The entries in the table below indicate if a keyword is required.
The following types of literal are supported:
Type | Description |
---|---|
Bit String |
Written either as sequence of 0s and 1s, or as a sequence of hexadecimal digits. Examples:
B'1010110111' X'3CF8' |
Boolean | Written as single bit value, either TRUE or FALSE . |
DateTime |
A date, time, or timestamp value. Written as a keyword followed by a string literal that defines the date, time, or timestamp value. The keyword differs depending on the expression. For information about, and examples that show, the required format, see:
|
Integer |
Written as a signed or unsigned integer number. Examples:
0 65535 -50 |
Interval |
A duration. Written as the INTERVAL keyword, followed by a string literal that defines the interval. For information about, and examples that show, the required format, see Expressions.expr-primary-interval. |
Location |
For use on systems that use Geo SCADA Expert's Geographical Location features. Written as the LOCATION keyword, followed by a string literal that defines the location. For information about, and examples that show, the required format, see Expressions.expr-primary-location. |
Real |
Written as a floating point number. Examples:
0.5 100.0 5.75E-4 -2.5E12 |
Region |
For use on systems that use Geo SCADA Expert's Geographical Location features. Written as the REGION keyword, followed by a string literal that defines the region. For information about, and examples that show, the required format, see Expressions.expr-primary-region. |
String |
A sequence of characters enclosed within single straight quotation marks. A single straight quotation mark is itself represented by two immediately adjacent single straight quotation marks (this is known as 'escaping'). Examples:
'Some Text'
|
All numeric values in SQL use the English decimal point (a dot).