SQL/MX 2.x Reference Manual (H06.04+)

SQL/MX Statements
HP NonStop SQL/MX Reference Manual540440-003
2-238
Publish/Subscribe Examples of UPDATE
INTO SQL DESCRIPTOR 'out_sqlda'
END-EXEC.
...
PERFORM UNTIL SQLSTATE NOT = SQLSTATE-OK
* Retrieve and test values in the descriptor area
...
EXEC SQL UPDATE CUSTOMER SET CREDIT = :new-default
WHERE CURRENT OF cursor1
END-EXEC.
EXEC SQL FETCH cursor1
INTO SQL DESCRIPTOR 'out_sqlda'
END-EXEC.
END-PERFORM.
Publish/Subscribe Examples of UPDATE
Suppose that these SQL/MP tables and index (and the metadata mappings) have been
created:
CREATE TABLE $db.dbtab.tab1 (a int NOT NULL, b int, c int);
CREATE TABLE $db.dbtab.tab2 (a int, b int, c int);
CREATE INDEX $db.dbtab.itab1 ON tab1(b, c);
CREATE SQLMP ALIAS cat.sch.tab1 $db.dbtab.tab1;
CREATE SQLMP ALIAS cat.sch.tab2 $db.dbtab.tab2;
This example shows the SET ON ROLLBACK clause:
SET SCHEMA cat.sch;
UPDATE tab1
SET b = b + 1
SET ON ROLLBACK a = a + 1
WHERE b < 10;
This example shows the SKIP CONFLICT access:
UPDATE tab1 SET a = a + 1
FOR SKIP CONFLICT ACCESS;