1-7. Commenting Your Code

Problem

You want to document your code with inline and multiline comments.

Solution

Place two dashes before any text to create a one-line comment. For example, in the following code there is a comment placed before the query to describe its functionality:

-- The following query obtains a count of rows from the employees table SELECT COUNT(*) FROM EMPLOYEES;

Multiline comments can be created beginning with a slash and asterisk (/*) and ending with an asterisk and slash (*/). The following lines depict a multiple-line comment for a given code block:

/* This comment describes the functionality       in the following code block. */

How It Works

Comments play a crucial role in code development. Not only are they useful ...

Get Oracle and PL/SQL Recipes: A Problem-Solution Approach now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.