1.

How do you represent comments in Oracle?

Answer»

In a SQL statement, a comment can be inserted between keywords, parameters, or punctuation marks. To add a comment to your SQL statement in Oracle/PLSQL, you have two options.

  • Single Line comment (--): In your SQL statement, you can begin the comment with two HYPHENS (--) at the END of the line and proceed with the comment text. Comment text cannot go beyond one line. The comment MUST be terminated with a line break.
    • Syntax: 
-- CommentText
  • Multi-line comment (/* */): In your SQL statement, you can begin the comment with a SLASH and an asterisk (/*) at the end of the line and proceed with the comment text. Comment text may span multiple lines, i.e., it can go beyond one line. The comment must be terminated with an asterisk and a slash (*/). There is no need to separate the opening and closing CHARACTERS with a space or a line break.
    • Syntax: 
/* Comment text  ... */


Discussion

No Comment Found