Reference Guide > TDV SQL Script > SQL Language Concepts > Value Expressions
 
Value Expressions
A value expression in a SQL Script is anything that resolves to a value.
Syntax
The syntax for a value expression is identical to a projection in a SELECT statement, except that instead of using column names you can use variable names in a value expression.
Remarks
Cursor variables cannot be used in a value expression by themselves, although attributes of cursor variables can be used. See DECLARE CURSOR of Type Variable for information on declaring cursor variables, and Attributes of Cursors for information on cursor attributes.
The keyword CURRENT_EXCEPTION cannot be used in a value expression by itself, although attributes of it can be used. For details, see Attributes of CURRENT_EXCEPTION.
Errors
The following table describes the errors that can occur while resolving a value expression.
Error Message
Cause
Undefined variable
An identifier is encountered that is not defined in the current scope.
Incorrect use of a cursor
A cursor is used in a value expression.
Incorrect use of CURRENT_EXCEPTION
The keyword CURRENT_EXCEPTION is used in a value expression.