版次注意事項


|38.2 Chapter 3. Language Elements

|38.2.1 Naming Conventions and Implicit Object Name Qualifications

|Add the following note to this section in Chapter 3:

|   The following names, when used in the context of SQL Procedures,
|   are restricted to the characters allowed in an
|   ordinary identifier, even if the names are delimited:
| 
|   - condition-name
|   - label
|   - parameter-name
|   - procedure-name
|   - SQL-variable-name
|   - statement-name

|38.2.2 DATALINK Assignments

|A paragraph in this section has been changed to the following:

|   Note that the size of a URL parameter or function result is the same
|   on both input or output and is bound by the length of the DATALINK column.
|   However, in some cases the URL value returned has an access token attached.
|   In situations where this is possible, the output location must have
|   sufficient storage space for the access token and the length of
|   the DATALINK column. Hence, the actual length of the comment and
|   URL in its fully expanded form provided on input should be restricted
|   to accommodate the output storage space. If the restricted length is
|   exceeded, this error is raised.

|38.2.3 Expressions

|38.2.3.1 Syntax Diagram

|The syntax diagram has changed:

|   .-operator------------------------------.
|   V                                       |
|>>----+-----+---+-function--------------+--+-------------------><
|      +- + -+   +-(expression)----------+
|      '- - -'   +-constant--------------+
|                +-column-name-----------+
|                +-host-variable---------+
|                +-special-register------+
|                +-(scalar-fullselect)---+
|                +-labeled-duration------+
|                +-case-expression-------+
|                +-cast-specification----+
|                +-dereference-operation-+
|                +-OLAP-function---------+
|                +-method-invocation-----+
|                +-subtype-treatment-----+
|                '-sequence-reference----'
| 
|operator
| 
|             (1)
||---+-CONCAT------+---------------------------------------------|
|    +- / ---------+
|    +- * ---------+
|    +- + ---------+
|    '- - ---------'
| 

|Note:

  1. ||| may be used as a synonym for CONCAT. |

|38.2.3.2 OLAP Functions

|The following represents a correction to the "OLAP Functions" section under |"Expressions" in Chapter 3.

| 
|aggregation-function
| 
||--column-function--OVER---(--+------------------------------+-->
|                              '-| window-partition-clause |--'
| 
|>----+--------------------------------------------------------------------+>
|     '-| window-order-clause |--+--------------------------------------+--'
|                                '-| window-aggregation-group-clause |--'
| 
|>---------------------------------------------------------------|
| 
|window-order-clause
| 
|              .-,-------------------------------------------.
|              V                       .-| asc option |---.  |
||---ORDER BY-----sort-key-expression--+------------------+--+---|
|                                      '-| desc option |--'
| 
|asc option
| 
|         .-NULLS LAST--.
||---ASC--+-------------+----------------------------------------|
|         '-NULLS FIRST-'
| 
|desc option
| 
|          .-NULLS FIRST--.
||---DESC--+--------------+--------------------------------------|
|          '-NULLS LAST---'
| 
|window-aggregation-group-clause
| 
||---+-ROWS--+---+-| group-start |---+---------------------------|
|    '-RANGE-'   +-| group-between |-+
|                '-| group-end |-----'
| 
|group-end
| 
||---+-UNBOUNDED FOLLOWING-----------+---------------------------|
|    '-unsigned-constant--FOLLOWING--'
| 

|In the window-order-clause description: |

|NULLS FIRST
|The window ordering considers null values before all non-null values |in the sort order.

|NULLS LAST
|The window ordering considers null values after all non-null values |in the sort order. |

|In the window-aggregation-group-clause description: |

|window-aggregation-group-clause
|The aggregation group of a row R is a set of rows, defined relative |to R in the ordering of the rows of R's partition. This clause specifies |the aggregation group. If this clause is not specified, the default is the |same as RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW, providing a cumulative |aggregation result. |

|ROWS
|Indicates the aggregation group is defined by counting rows.

|RANGE
|Indicates the aggregation group is defined by an offset from a sort |key.

|group-start
|Specifies the starting point for the aggregation group. The aggregation |group end is the current row. Specification of the group-start clause is |equivalent to a group-between clause of the form "BETWEEN group-start AND |CURRENT ROW".

|group-between
|Specifies the aggregation group start and end based on either ROWS |or RANGE.

|group-end
|Specifies the ending point for the aggregation group. The aggregation |group start is the current row. Specification of the group-end clause |is equivalent to a group-between clause of the form "BETWEEN |CURRENT ROW AND group-end".

|UNBOUNDED PRECEDING
|Includes the entire partition preceding the current row. This can be |specified with either ROWS or RANGE. Also, this can be specified with multiple |sort-key-expressions in the window-order-clause.

|UNBOUNDED FOLLOWING
|Includes the entire partition following the current row. This can be |specified with either ROWS or RANGE. Also, this can be specified with multiple |sort-key-expressions in the window-order-clause.

|CURRENT ROW
|Specifies the start or end of the aggregation group based on the current |row. If ROWS is specified, the current row is the aggregation group boundary. |If RANGE is specified, the aggregation group boundary includes the set of |rows with the same values for the sort-key-expressions as the current |row. This clause cannot be specified in group-bound2 if group-bound1 specifies value FOLLOWING.

|value PRECEDING
|Specifies either the range or number of rows preceding the current |row. If ROWS is specified, then value is a positive integer indicating |a number of rows. If RANGE is specified, then the data type of value must be comparable to the type of the sort-key-expression of the window-order-clause. |There can only be one sort-key-expression, and the data type of the sort-key-expression |must allow subtraction. This clause cannot be specified in group-bound2 if group-bound1 is CURRENT ROW or value FOLLOWING.

|value FOLLOWING
|Specifies either the range or number of rows following the current |row. If ROWS is specified, then value is a positive integer indicating |a number of rows. If RANGE is specified, then the data type of value must be comparable to the type of the sort-key-expression of the window-order-clause. |There can only be one sort-key-expression, and the data type of the sort-key-expression |must allow addition. |
|

|38.2.3.3 Sequence Reference

|The following information should be added to the end of the Expressions |section (after "Subtype Treatment"). | | | | | | |

| 
|sequence-reference
| 
||--+-| nextval-expression |-+-----------------------------------|
|   '-| prevval-expression |-'
| 
|nextval-expression
| 
||---NEXTVAL FOR--sequence-name----------------------------------|
| 
|prevval-expression
| 
||---PREVVAL FOR--sequence-name----------------------------------|
| 
|

|NEXTVAL FOR sequence-name
|A NEXTVAL expression returns the next value for the sequence specified |by sequence-name.

|PREVVAL FOR sequence-name

|A PREVVAL expression returns the most recently generated |value for the specified sequence for a previous statement within the current |session. This value can be repeatedly referenced using PREVVAL expressions |specifying the name of the sequence. There may be multiple instances of PREVVAL |expressions specifying the same sequence name within a single statement and |they all return the same value.

|A PREVVAL expression can only be used |if a NEXTVAL expression specifying the same sequence name has already been |referenced in the current user session (in the current or a previous transaction) |(SQLSTATE 51035). |

|Note:
| |

|Examples:

|These examples assume that there is a table called "order" and that |a sequence called "order_seq" is created as follows:

|CREATE SEQUENCE order_seq
|   START WITH 1
|   INCREMENT BY 1
|   NOMAXVALUE
|   NOCYCLE
|   CACHE 24
|


[ 頁面頂端 | 前一頁 | 下一頁 | 目錄 | 索引 ]