SQL/MX 3.1 Query Guide (H06.23+, J06.12+)

SQL/MX Operators
HP NonStop SQL/MX Release 3.1 Query Guide663851-001
7-56
PACK Operator
Prepare TestQuery11 from
insert into table_a values('A', 1, 1);
DESCRIPTION
fragment_id ............ 0
parent_frag ............ (none)
fragment_type .......... master
union_type ............... merge
PACK Operator
Rowset Group
Use the PACK operator in a query plan when selecting rows into rowset arrays:
SELECT <list> INTO <list of arrays> <body of query>
The PACK operator collects all the rows coming from the body of the query and puts
them into the arrays in the <list of arrays>. For more information about rowsets
and arrays, see the SQL/MX Programming Manual for C and COBOL.
The PACK operator has one child. The description field for this operator contains:
Create a module file. For details on creating module file, see the SQL/MX
Programming Manual for C and COBOL.
Now execute the following command:
explain <name of a statement in module file> from <name of
module file>
The following is an example of the PACK operator:
DESCRIPTION
fragment_id ............ 0
parent_frag ............ (none)
fragment_type .......... master
pack_expr .............. (cast(JAVCAT.JAVSCH.T.T1 AS INTEGER
SIGNED)RowsetArrayInto 200 ),
(cast(JAVCAT.JAVSCH.T.T2 AS
INTEGER SIGNED) RowsetArrayInto 200),
Token Followed by... Data Type
fragment_id A sequential number assigned to the fragment.
0 is always the master executor and 1 is
reserved for the EXPLAIN plan. Numbers 2 to n
will be ESP or DAM fragments.
integer
parent_frag The fragment_id for the parent of the current
fragment. The value is (none) for the master
executor.
integer
fragment_type Master, ESP, or DP2. text
pack_expr Expression used to pack values of a row into a
packed row.
expr(text)
TP663851.fm Page 56 Monday, October 17, 2011 11:48 AM