Notes
Comments: Comments can be included within the body
of an SQL procedure. In addition to the double-dash form of comments (--),
a comment can begin with /* and end with */. The following rules apply to this form of a comment.
- The beginning characters /* must be adjacent and on the same line.
- The ending characters */ must be adjacent and on the same line.
- Comments can be started wherever a space is valid.
- Comments can be continued to the next line.
Labels:
Labels can be specified on most SQL procedure statements. If a label is specified
on an SQL procedure statement, it must be unique from other labels within
the same scope.
- The label must not be the same as any other label within the same compound-statement.
- The label must not be the same as a label specified on the compound-statement itself.
- If the compound-statement is nested within another compound-statement, the label must not be the same as
the label specified on any higher level compound-statement.
- The label must not be the same as the name of the SQL function, SQL procedure,
or SQL trigger that contains the SQL procedure statement.
Handling errors and warnings: Conditions can be detected within an SQL
procedure by the following methods:
- testing the special SQL variables SQLSTATE and SQLCODE.
- issuing a GET DIAGNOSTICS statement to request the condition information.
See GET DIAGNOSTICS statement.
- defining condition handlers to detect and process conditions. See compound-statement.
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.