SQL/MX 2.x Reference Manual (G06.24+, H06.03+)
SQL/MX Statements
HP NonStop SQL/MX Reference Manual—523725-004
2-241
MXCI Examples of UPDATE
Although NonStop SQL/MX cannot successfully update all rows and return the
requested results, it does not return an error. Instead, only one row is updated, and the
results for this single updated row are returned in the set of host variables.
If you execute the same SELECT UPDATE statement in MXCI NonStop SQL/MX
returns these results:
>>select * from
+>(update =TAB1
+>set v3 = 'DCBA'
+>WHERE k1 ='0001'
+>SKIP CONFLICT ACCESS)
+>AS PIPO
+>READ UNCOMMITTED ACCESS
+>;
K1 K2 V3
---- ---- ------------------------------------------------------
0001 AAAA DCBA
0001 BBBB DCBA
--- 2 row(s) selected.
>>
NonStop SQL/MX updates both rows.
MXCI Examples of UPDATE
•
Update a single row of the ORDERS table that contains information about order
number 200300 and change the delivery date:
UPDATE sales.orders
SET deliv_date = DATE '1998-05-02'
WHERE ordernum = 200300;
•
Update several rows of the CUSTOMER table:
UPDATE sales.customer
SET credit = 'A1'
WHERE custnum IN (21, 3333, 324);
•
Update all rows of the CUSTOMER table to the default credit 'C1':
UPDATE sales.customer
SET credit = 'C1';
•
Update the salary of each employee working for all departments located in
Chicago:
UPDATE persnl.employee
SET salary = salary * 1.1
WHERE deptnum IN
(SELECT deptnum FROM persnl.dept
WHERE location = 'CHICAGO');