Expressions

Expressions are formed from several different kinds of elements, such as constants, column names, SQL operators, and subqueries.

Syntax

expression:
case-expression
| constant
| [ correlation-name. ] column-name java-ref ]
| - expression
| expression operator expression
| ( expression )
| function-nameexpression, … )
| if-expression
| [ java-package-name. ] java-class-name java-ref
| ( subquery )
| variable-namejava-ref ]

Parameters

case-expression:
{ CASE search-condition
... WHEN expression THEN expression [ , … ]
... [ ELSE expression ] 
END
| CASE
... WHEN search-condition THEN expression [ , … ]
... [ ELSE expression ] 
END }
constant:
{ integer | number | 'string' | special-constant | host-variable }
special-constant:
{ CURRENTDATE | TIME | TIMESTAMP | USER }
| LAST USER
| NULL
| SQLCODE
| SQLSTATE }
if-expression:
IF condition
... THEN expression
... [ ELSE expression ]
ENDIF
java-ref:
{ .field-namejava-ref ]
| >> field-namejava-ref ]
| .method-name ( [ expression ] [ , … ] ) [ java-ref ]
| >> method-name ( [ expression ] [ , … ] ) [ java-ref ] }
operator:
+ | - | * | /|| % }

Usage

Anywhere.

Authorization

Must be connected to the database.

Side effects

None.

Compatibility

  • The IF condition is not supported in Adaptive Server Enterprise.

  • Java expressions are not currently supported in Adaptive Server Enterprise.

  • For other differences, see the separate descriptions of each class of expression, in the following sections.

Related concepts
SQL Operators
Subqueries in Search Conditions
Special Values
CASE Statement Support
Related reference
Comparison Conditions
NULL Value
Search Conditions
Strings
Three-Valued Logic