SQL/MX 2.x Reference Manual (G06.24+, H06.03+)
Introduction
HP NonStop SQL/MX Reference Manual—523725-004
1-4
Transactions in MXCI
All text between two hyphens and the end of the physical line is a comment. You can
include a comment within a statement or command (but not within a literal) if you use
more than one physical line to enter the statement or command.
If you include comments in an MXCI command file, MXCI prints the comments along
with the commands as it executes the file.
Examples of SQL Comments
•
Show comments and SQL statements from an MXCI command file—and the
output from the SQL statements—as displayed by MXCI when the file is executed:
-- This example shows a use of the AVG function
SELECT AVG (salary) FROM persnl.employee;
(EXPR)
----------------
49441.52
--- 1 row(s) selected.
-- This example shows a use of the DISTINCT clause.
SELECT AVG (DISTINCT SALARY)
FROM PERSNL.EMPLOYEE;
(EXPR)
----------------
53609.89
--- 1 row(s) selected.
Transactions in MXCI
A transaction can be user-defined or system-defined. If you attempt to exit an MXCI
session when either type of transaction is active, MXCI prompts you to specify whether
to commit or roll back the work of the transaction as:
There is an active transaction. Do you want to commit the
transaction?
Y to commit transaction
N to abort transaction
Any other key to resume:
During an MXCI session, if the input is read from a file rather than from the keyboard
and a transaction is active when MXCI reaches the end of the input file, that
transaction is rolled back. You must issue a COMMIT WORK or ROLLBACK WORK
explicitly within the command file (after the DML statements).
Query Interruption and Termination in MXCI
In MXCI, you can interrupt and terminate a statement or command by pressing the
MXCI break key. The MXCI break key can be either Ctrl-c, Ctrl-Break, or the
OutsideView Break icon, depending on your interface.