SQL/MX 3.2.1 Query Guide (H06.26+, J06.15+)

SQL/MX Operators
HP NonStop SQL/MX Release 3.2.1 Query Guide663851-003
7-66
SEQUENCEGENERATOR Operator
For more information about data mining, see the SQL/MX Data Mining Guide.
The following is an example of the SEQUENCE operator:
prepare TestQuery24 from
SELECT RUNNINGCOUNT(*) FROM customer
SEQUENCE BY c_custkey, c_nationkey;
DESCRIPTION
fragment_id ............ 0
parent_frag ............ (none)
fragment_type .......... master
num_history_rows ....... 1,024
history_row_size ....... 16
required_order ......... DETCAT.DETSCH.CX1.C_CUSTKEY,
DETCAT.DETSCH.CX1.C_NATIONKEY
sequence_functions ..... (replace null(offset(\:_sys_Result),
cast(offset(\:_sys_Result) AS
LARGEINT), cast(0 AS LARGEINT)) +
replace null(1 , cast(1 AS INTEGER
SIGNED), cast(0 AS INTEGER
SIGNED)))
SEQUENCEGENERATOR Operator
The SEQUENCEGENERATOR operator provides access to the sequence generator
table to get the next value or the next block of values. It temporarily suspends the
current user transaction, and starts and commits a new transaction to access the
sequence generator table.
The SEQUENCEGENERATOR operator is isolated into its own ESP by the
ESP_ACCESS operator.
sequence_functions Represents the list of sequence functions that
must be evaluated by this SEQUENCE
operator.
ItemExpr
tree
num_history_rows Size of the history buffer (in rows). This
number of rows is kept in an integer buffer and
is available for access by the sequence
functions. Any access to a row outside this
buffer results in a NULL value. The default
value for this parameter is 1024 rows.
integer
history_row_size Size of each history row in the history buffer. integer
TP663851.fm Page 66 Wednesday, January 30, 2013 5:37 PM