|PL/SQL User's Guide and Reference
Part Number A89856-01
PL/SQL Language Elements, 9 of 52
Comments describe the purpose and use of code segments and so promote readability. PL/SQL supports two comment styles: single-line and multi-line. Single-line comments begin with a double hyphen (
- -) anywhere on a line and extend to the end of the line. Multi-line comments begin with a slash-asterisk (
/*), end with an asterisk-slash (
*/), and can span multiple lines. For more information, see "Comments".
Comments can appear within a statement at the end of a line. However, you cannot nest comments.
You cannot use single-line comments in a PL/SQL block that will be processed dynamically by an Oracle Precompiler program because end-of-line characters are ignored. As a result, single-line comments extend to the end of the block, not just to the end of a line. Instead, use multi-line comments.
While testing or debugging a program, you might want to disable a line of code. The following example shows how you can "comment-out" the line:
You can use multi-line comment delimiters to comment-out whole sections of code.
The following examples show various comment styles: