|
|
Table of Contents
- Expression
- Scope
- SQL Syntax
- Parameters
- Description
- Example
- Add Months Function
- Scope
- SQL Syntax
- Parameters
- Description
- Example
- Aggregate Functions
- Scope
- SQL Syntax
- Parameters
- Description
- Example
- CAST Function
- Scope
- SQL Syntax
- Parameters
- Description
- Examples
- Constant
- Scope
- SQL Syntax
- Parameters
- Current Functions
- Scope
- SQL Syntax
- Description
- Examples
- Date/Time Functions
- Scope
- SQL Syntax—Conversion Functions
- Parameters—Conversion Functions
- SQL Syntax—FormatSpecification
- Parameters—FormatSpecification
- Description
- Examples
- Long Column Functions
- Scope
- SQL Syntax
- Parameters
- Description
- Examples
- String Functions
- Function Specification
- Examples:
- Scope
- SQL Syntax
- Parameters
- Description
- Examples
- TID Function
- Scope
- SQL Syntax
- Parameters
- Description
- Example
This chapter discusses value specification. The following sections are
presented:
Expression
Add Months Function
Aggregate Functions
CAST Function
Constant
Current Functions
Date/Time Functions
Long Column Functions
String Functions
TID Function
An expression specifies a value to be obtained in one of the
following ways:
From a column of a table
From a host variable in an application program
From a dynamic parameter
From a local variable or parameter in a procedure
From a constant
By adding, subtracting, multiplying, dividing, or negating
values
By evaluating an aggregate function
By evaluating a date/time (conversion, current, or add months)
function
By evaluating a long column or string function
By a combination of these methods
Expressions are used for several purposes including:
To identify columns. In the SELECT statement, expressions
are used in the select list to identify column values to be retrieved.
The SELECT statement is also part of the CREATE VIEW,
DECLARE CURSOR, and INSERT statements. The expressions in
this case identify columns that qualify for the view, the cursor, or
the insert operation.
To identify rows. In the search condition of the following
statements, expressions help define the set of rows affected:
SELECT, INSERT, UPDATE, DELETE, CREATE VIEW, and
DECLARE. Refer to the "Search Conditions" chapter for more
information.
To define new column values. In the UPDATE statement,
expressions define a new value for a column in an existing
row.
|