SQL/MX 3.2 Query Guide (H06.25+, J06.14+)

SQL/MX Operators
HP NonStop SQL/MX Release 3.2 Query Guide663851-002
7-6
CALL Operator
table_b(col1, col2) on update restrict on delete restrict
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)=
(table_a.col1,table_a.col2)
AND table_a.col3 = 1
)
WHERE (table_b.col1,table_b.col2)=
(newrow.col1,newrow.col2);
insert into table_b values('A', 1, 1, 0);
Prepare TestQuery11 from
insert into table_a values('A', 1, 1);
DESCRIPTION
fragment_id ............ 0
parent_frag ............ (none)
fragment_type .......... master
union_type ............. merge
CALL Operator
User-Defined Routine (UDR)
The CALL operator indicates that a UDR was used.
The CALL operator has no child nodes. The description field for this operator contains
the following:
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
input_values Input values to the CALL statement. One
SQL/MX expression is returned for each IN or
INOUT parameter. Nothing is returned for
OUT parameters.
expr(text)
The max_results_sets token is supported only on systems running J06.05 and later J-series RVUs and H06.16
and later H-series RVUs.
TP663851.fm Page 6 Thursday, August 2, 2012 4:47 PM