Expression types
The following are expression types supported in SQL Assist:
- Function
Functions can be either built-in or user-defined. Function expressions can be used for data transformations or for capturing common expression patterns. They are further distinguished into scalar, aggregate (column), and table functions.
- Special register
A special register is a storage area that is defined for an application process by the database manager. Special registers are used to store information that can be referenced in SQL statements. Special registers are in the database code page.
- Host variable
A host variable is either of these:
- A variable in a host language such as a C variable, a C++ variable, a COBOL data item, a FORTRAN variable, or a Java variable.
- A host language construct that was generated by an SQL precompiler from a variable declared using SQL extensions.
A host variable is referenced in an SQL statement. Host variables are either directly defined by statements in the host language or are indirectly defined using SQL extensions.
- Labeled duration
A labeled duration represents a specific unit of time as expressed by a number (which can be the result of an expression) followed by one of the seven duration keywords: YEARS, MONTHS, DAYS, HOURS, MINUTES, SECONDS, or MICROSECONDS. The number specified is converted as if it were assigned to a DECIMAL(15,0) number. A labeled duration can be used only as an operand of an arithmetic operator in which the other operand is a value of data type DATE, TIME, or TIMESTAMP.
- Literal value
A literal value (also called a constant) specifies a value. Literal values are classified as string or numeric. Numeric literal values are further classified as integer, floating-point, or decimal.
- Case expression
Case expressions allow an expression to be selected based on the evaluation of one or more conditions. In general, the value of the case expression is the value of the result expression that follows the first (leftmost) case that evaluates to true. If no case evaluates to true and the ELSE keyword is present, then the result is the value of the result expression or NULL. If no case evaluates to true and the ELSE keyword is not present, then the result is NULL. When a case evaluates to unknown because of one or more NULL conditions, the case is not true and hence is treated the same way as a case that evaluates to false. SQL Assist supports simple case expressions, but not searched-case expressions.
Return to Add expressions.