Comments about SQL scripts in Oracle DB (REM ,--,/**/)

Source: Internet
Author: User

SQL Script annotation syntax in Oracle DB

  1. REM Single line comment
  2. -- Single line comment
  3. /* Single line comment */
  4. /*
  5. Multi Line
  6. Comment
  7. */

Supplement: REM is short for REMARK.

So what is the difference between REM and?

-- Or/**/can be used for PL/SQL, but REM [ark] cannot.

The following section can be executed successfully in SQL * PLUS.

  1. REM comment
  2. -- Comment
  3. /* Comment */
  4. Begin
  5. DBMS_OUTPUT.PUT_LINE ('Test');-- Comment
  6. DBMS_OUTPUT.PUT_LINE ('Test');/* Comment */
  7. End;
  8. /
But the following section won't work.
  1. Begin
  2. DBMS_OUTPUT.PUT_LINE ('Test'); REM comment
  3. End;
  4. /
  5. Begin
  6. REM comment
  7. DBMS_OUTPUT.PUT_LINE ('Test');
  8. End;
  9. /
11.2 documentation on all comment types has a clear description of the annotations.

You can enter comments in a script in three ways:

  • Using the SQL * Plus REMARK command for single line comments.

  • Using the SQL comment delimiters/*... */for single or multi-line comments.

  • Using ANSI/ISO (American National Standards Institute/International Standards Organization) comments--for single line comments.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.