Home >Database >Oracle >What are the oracle code segment comment symbols?

What are the oracle code segment comment symbols?

藏色散人
藏色散人Original
2020-10-16 11:10:425515browse

Oracle code segment comment symbols start with "/*" and end with "*/". The comment method is such as "/*IF 2 2 = 4 THEN some_condition := TRUE; END IF;*/".

What are the oracle code segment comment symbols?

Recommended: "oracle tutorial"

Comments in Oracle PL/SQL code

Comments on Oracle PL/SQL code can be divided into two types:

- 单行注释
- 多行注释

Single-line comments start with "--", for example:

-- DELETE FROM employees WHERE comm_pct IS NULL

Multi-line comments start with "/ *" and ends with "*/", for example:

/*
 IF 2 + 2 = 4 THEN
        some_condition := TRUE; 
    END IF; 
*/

However, multi-line comments cannot be nested within multi-line comments, for example:

/*
     IF 2 + 2 = 4 THEN
        some_condition := TRUE;
     /* We expect this THEN to always be performed */ 
    END IF;
 */

This is not allowed and a syntax error will be reported. . However, single-line comments can be included within multi-line comments, for example:

/* 
  IF 2 + 2 = 4 THEN
    some_condition := TRUE; 
 -- We expect this THEN to always be performed
  END IF; 
*/

This is allowed. However, multi-line comments can contain the starting characters of multi-line comments, for example:

/* 
  IF 2 + 2 = 4 THEN
    some_condition := TRUE; 
 /* We expect this THEN to always be performed
  END IF; 
*/

This is also allowed. But it cannot contain ending characters, for example:

/* 
  IF 2 + 2 = 4 THEN
    some_condition := TRUE; 
 We expect this THEN to always be performed */
  END IF; 
*/

This is not allowed and there is a syntax error

The above is the detailed content of What are the oracle code segment comment symbols?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn