Expressions

An expression is a combination of one or more constants, literals, functions, column identifiers and/or variables, separated by operators, that returns a single value. Expressions can be of several types, including arithmetic, relational, logical (or Boolean), and character string. In some Transact-SQL clauses, a subquery can be used in an expression. A case expression can be used in an expression.

Table 4-1 lists the types of expressions that are used in Adaptive Server syntax statements.

Table 4-1: Types of expressions used in syntax statements

Usage

Definition

expression

Can include constants, literals, functions, column identifiers, variables, or parameters

logical expression

An expression that returns TRUE, FALSE, or UNKNOWN

constant expression

An expression that always returns the same value, such as “5+3” or “ABCDE”

float_expr

Any floating-point expression or an expression that implicitly converts to a floating value

integer_expr

Any integer expression or an expression that implicitly converts to an integer value

numeric_expr

Any numeric expression that returns a single value

char_expr

Any expression that returns a single character-type value

binary_expression

An expression that returns a single binary or varbinary value