SQL/MP Reference Manual

HP NonStop SQL/MP Reference Manual523352-013
C-72
Examples—CONTINUE
An SQLCI process that does not use a terminal as an IN file (for example, one
which reads SQLCI commands from a disk file) also protects you from modifying
DEFINEs but does not protect you from terminating the SQLCI process.
Terminating the SQLCI process while an operation in progress is waiting for a
CONTINUE statement (either by reaching the end of the IN file or by executing an
EXIT command) leaves SQL objects in the inconsistent state described earlier in
this consideration.
A host language process does not protect you against either modifying DEFINEs
or terminating the process unless you explicitly code such protection into the
program. Make sure that a host language process that receives warning 1619
responds with a CONTINUE statement before terminating or taking any action that
modifies a DEFINE.
Examples—CONTINUE
This SQLCI example cancels a DDL operation about to begin its final phase:
>> ALTER TABLE $D1.MDB.EMP PARTONLY MOVE $D2.MDB.EMP
WITH SHARED ACCESS NAME MOVE_EMP_TABLE
COMMIT BY REQUEST;
*** WARNING from SQL [1618]: The MOVE_EMP_TABLE
statement is ready to commit.
*** WARNING from SQL [1619]: To continue processing, please
enter a commit or rollback with a CONTINUE statement.
D>CONTINUE MOVE_EMP_TABLE ROLLBACK WORK;
*** ERROR from SQL [-1620]: The ROLLBACK was requested
as part of the commit criteria. The command has
been aborted.
>>
This SQLCI example commits a DDL operation about to begin its final phase. The
example uses a FUP LISTOPENS command to verify that there is no activity on
the partition being moved before issuing a CONTINUE statement.
>> ALTER TABLE $D1.MDB.PART1 PARTONLY MOVE $D2.MDB.PART1
WITH SHARED ACCESS NAME PART1_MOVE
COMMIT BY REQUEST;
*** WARNING from SQL [1618]: The PART1_MOVE statement is
ready to commit.
*** WARNING from SQL [1619]: To continue processing, please
enter a commit or rollback with a CONTINUE statement.
D>FUP LISTOPENS $D1.MDB.PART1;
D>CONTINUE PART1_MOVE COMMIT WHEN READY
ONCOMMITERROR COMMIT BY REQUEST;
--- SQL operation complete.
>>
Note. SQL does not prohibit you from executing a transaction between receiving warning
1619 and executing a CONTINUE statement, but you must complete the transaction
before executing the CONTINUE statement. Attempting to execute a CONTINUE
statement within a transaction causes SQL to roll back both the operation you attempted to
CONTINUE and any other operations included in the transaction.