3.6. CommentsInline documentation, otherwise known as comments PL/SQL offers two different styles for comments: single-line and multiline block comments. 3.6.1. Single-Line Comment SyntaxThe single-line comment is initiated with two hyphens (), which cannot be separated by a space or any other characters. All text after the double hyphen to the end of the physical line is considered commentary and is ignored by the compiler. If the double hyphen appears at the beginning of the line, the whole line is a comment. Remember: the double hyphen comments out the remainder of a physical line, not a logical PL/SQL statement. In the following IF statement, I use a single-line comment to clarify the logic of the Boolean expression:
3.6.2. Multiline Comment SyntaxWhile single-line comments are useful for documenting brief bits of code or ignoring a line that you do not want executed at the moment, the multiline comment is superior for including longer blocks of commentary. Multiline comments start with a slash-asterisk (/*) and end with an asterisk-slash (*/). PL/SQL considers all characters found between these two sequences of symbols to be part of the comment, and they are ignored by the compiler. The following example of multiline comments
You can also use multiline comments to block out lines of code for testing purposes. In the following example, the additional clauses in the EXIT statement are ignored so that testing can concentrate on the a_delimiter function:
|
Thursday, October 22, 2009
Section 3.6. Comments
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment