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

Introduction
HP NonStop SQL/MX Reference Manual540440-003
1-4
SQL Comments
SQL Comments
You can include comments in MXCI input lines. Comments are useful for describing a
statement or command. You can also use comments to disable specific statements or
commands without removing them from the source code, such as for debugging
purposes.
To indicate that an MXCI line is a comment, precede the comment with two hyphens
(--):
-- comment-text
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.