Expressions
An expression specifies a value and can take a number of different forms, such as a simple value, consisting of only a constant or a column name, or it can be more complex with operators, other expressions, and more.
Authorization
The use of some of the expressions, such as a scalar-fullselect, sequence-reference, global-variable, or function-invocation, requires having the appropriate authorization. For these objects, the privilege set that is defined below must include the following authorization:
- cast-specification. The authorization to reference a user-defined type in a cast specification. For information about authorization considerations, see CAST specification.
- function-invocation. Authorization to execute the function. For information about how the particular function is chosen and authorization considerations, see Function resolution.
- scalar-fullselect. For information about authorization considerations, see Authorization for queries.
- sequence-reference. The USAGE privilege on the specified sequence, ownership of the sequence, DATAACCESS authority, or SYSADM authority. For example, with a sequence reference, USAGE authorization on the sequence is required.
- global-variable. The READ privilege on the specified global variable, ownership of the global variable, DATAACCESS authority, or SYSADM authority.
Privilege set: If the statement is embedded in an application program, the privilege set is the privileges that are held by the owner of the plan or package. If the statement is dynamically prepared, the privilege set is the union of the privilege sets that are held by each authorization ID of the process.
Syntax
The form of an expression is as follows:
- 1 Must be a scalar function. See Functions for more information.
- 2 See Scalar-fullselect for more information.
- 3 See Labeled durations for more information.
- 4 See CASE expressions for more information.
- 5 See CAST specification for more information.
- 6 See XMLCAST specification for more information.
- 7 See Array element specification for more information.
- 8 See Array constructor for more information.
- 9 See OLAP specifications
- 10 See ROW CHANGE expression
- 11 See Sequence reference
operator:
Expressions without operators
If no operators are used, the result of the expression is the specified value. Each of the following examples is an expression that specifies a value based on a column named SALARY:
SALARY :SALARY 'SALARY' MAX(SALARY)