SQL/MX 3.2 Reference Manual (H06.25+, J06.14+)

SQL/MX Language Elements
HP NonStop SQL/MX Release 3.2 Reference Manual691117-001
6-41
Expressions
Expressions
An SQL value expression, referred to as an expression, can evaluate to a value with
one of these:
The data type of an expression is the data type of the value of the expression.
A value expression can be, among other things, a character string literal, a numeric
literal, a host variable, a dynamic parameter, or a column name that specifies the value
of the column in a row of a table. A value expression can also include, among other
operands, functions and scalar subqueries.
Character Value Expressions
The operands of a character value expression—referred to as character primaries—
can be combined with the concatenation operator (||). The data type of a character
primary is character string.
Character Value Expressions
on page 6-41
Operands can be combined with the concatenation
operator (||). Example: 'HOUSTON,' ||' TEXAS'
Datetime Value Expressions
on
page 6-43
Operands can be combined in specific ways with
arithmetic operators.
Example: CURRENT_DATE + INTERVAL '1' DAY
Interval Value Expressions
on
page 6-47
Operands can be combined in specific ways with addition
and subtraction operators.
Example: INTERVAL '2' YEAR
- INTERVAL '3' MONTH
Numeric Value Expressions
on
page 6-52
Operands can be combined in specific ways with
arithmetic operators. Example: SALARY * 1.10
Rowset Expressions
on
page 6-55
Operands can be combined to form rowset expressions.
character-expression is:
character-primary
| character-expression || character-primary
character-primary is:
character-string-literal
| column-reference
| character-type-host-variable
| dynamic parameter
| character-value-function
| aggregate-function
| sequence-function
| scalar-subquery
| CASE-expression
| CAST-expression
| (character-expression)