|PL/SQL User's Guide and Reference
10g Release 1 (10.1)
Part Number B10807-01
PL/SQL supports two comment styles: single-line and multi-line. A double hyphen (
- -) anywhere on a line (except within a character literal) turns the rest of the line into a comment. Multi-line comments begin with a slash-asterisk (
/*) and end with an asterisk-slash (
*/). For more information, see "Comments".
Single-line comments can appear within a statement at the end of a line.
You can include single-line comments inside multi-line comments, but you cannot nest multi-line comments.
You cannot use single-line comments in a PL/SQL block that will be processed dynamically by an Oracle Precompiler program. End-of-line characters are ignored, making the single-line comments extend to the end of the block. 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:
-- UPDATE department SET location_id = my_loc WHERE department_id = my_deptno;
You can use multi-line comment delimiters to comment-out whole sections of code.
The following examples show various comment styles:
DECLARE area NUMBER; pi NUMBER; radius NUMBER; BEGIN -- Compute the area of a circle area := pi * radius**2; -- pi is approx. 3.14159 /* Compute the area of a circle. */ area := pi /* pi is approx. 3.14159 */ * radius**2; END; /