Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » SQL Anywhere Server - SQL Reference » SQL Language Elements

Operator precedence Next Page

Expressions


An expression is a statement that can be evaluated to return values.

Syntax

expression:
case-expression
| constant
| [correlation-name.]column-name
| - expression
| expression operator expression
| ( expression )
| function-name ( expression, ... )
| if-expression
| special value
| ( subquery )
| variable-name

Parameters

case-expression:
CASE expression
WHEN expression
THEN expression,...
[ ELSE expression ]
END

alternative form of case-expression:
CASE
WHEN search-condition
THEN expression, ...
[ ELSE expression ]
END

constant:
integer | number | string | host-variable

special-value:
CURRENT { DATE | TIME | TIMESTAMP }
| NULL
| SQLCODE
| SQLSTATE
| USER

if-expression:
IF condition
THEN expression
[ ELSE expression ]
ENDIF

operator:
{ + | - | * | / | || | % }

Remarks

Expressions are used in many different places.

Expressions are formed from several different kinds of elements. These are discussed in the sections on functions and variables. See SQL Functions, and Variables.

You must be connected to the database in order evaluate expressions.

Side effects

None.

See also
Standards and compatibility

Constants in expressions
Column names in expressions
Subqueries in expressions
IF expressions
CASE expressions
Compatibility of expressions