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-89
VALUES Operator
VALUES Operator
Tuple Group
The VALUES operator calculates an expression for each row it receives from its child
node and returns that expression to its parent node.
The VALUES operator has one child node. The description field for this operator
contains the following:
The following is an example of the VALUES operator:
create table table_a
(col1 char(5) NOT NULL NOT DROPPABLE
, col2 int NOT NULL NOT DROPPABLE
, col3 smallint
, CONSTRAINT table_a_PRIMARY_KEY PRIMARY KEY (col1 ASC, col2
ASC) NOT DROPPABLE
);
create table table_b
(col1 char(5) NOT NULL NOT DROPPABLE
, col2 int NOT NULL NOT DROPPABLE
, col3 smallint
, owner_count int
, CONSTRAINT table_b_PRIMARY_KEY PRIMARY KEY (col1 ASC, col2
ASC) NOT DROPPABLE
);
ALTER TABLE table_a
ADD CONSTRAINT table_a_KEY FOREIGN KEY
(col1, col2) REFERENCES
table_b(col1, col2) DROPPABLE ;
CREATE TRIGGER table_a_Owner_Count
AFTER INSERT ON table_a
REFERENCING NEW AS newrow
FOR EACH ROW
UPDATE table_b SET owner_count = (
SELECT count(*) FROM table_a
WHERE (table_b.col1,table_b.col2)=
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
tuple_expr The tuple produced by this node. expr(text)
TP663851.fm Page 89 Wednesday, January 30, 2013 5:37 PM