NonStop SQL/MP Reference Manual

Table Of Contents
NonStop SQL/MP Reference Manual142115
B-3
Examples—BEGIN WORK
Examples—BEGIN WORK
The following example uses BEGIN WORK in SQLCI to group three separate
statements that update the database into a single TMF transaction:
>> VOLUME SALES;
>> BEGIN WORK;
>> INSERT INTO ORDERS VALUES (124, 860323, 860330, 75, 7654);
--- 1 ROW(S) INSERTED.
>> INSERT INTO ODETAIL VALUES (124, 4103, 25000, 2);
--- 1 ROW(S) INSERTED.
>> UPDATE INVENT.PARTLOC SET QTY_ON_HAND = QTY_ON_HAND -2
+> WHERE PARTNUM = 4103 AND LOC_CODE = "K43";
--- 1 ROW(S) UPDATED.
>> COMMIT WORK;
BETWEEN Predicate
BETWEEN is a predicate that determines whether a value is within a range of values.
Considerations—BETWEEN
BETWEEN is a comparison predicate. See Comparison Predicate on page C-53 for
a discussion of general rules for comparisons and specific information about
comparing character data (including character data associated with collations),
numeric data, date-time data, and interval data.
If you specify expr1 BETWEEN expr2 AND expr3, the predicate is true if the
following condition is true:
expr1 >= expr2 AND expr1 <= expr3
The three row-value-specs must contain the same number of expressions.
row-value-spec [NOT] BETWEEN row-value-spec AND
row-value-spec
row-value-spec is:
{expression[ ,expression] ... }
{ (expression[ ,expression] ... ) }