Home

Single line comments should start with --

Description

    The rule "Single line comments should start with --" states that any single line comments in PL/SQL code should begin with two hyphens (--). This is used to differentiate comments from other code, and to ensure that the comments are properly identified and ignored by the PL/SQL interpreter.

Key Benefits

  • Easy to read: -- Single line comments are easy to read and understand as they are short and concise.
  • Easy to write: -- Single line comments are easy to write as they don't require any special formatting.
  • Consistent: -- Single line comments provide a consistent way to document code, making it easier to read and understand.
  • Flexible: -- Single line comments can be used in any language, making them flexible and useful for a variety of coding tasks.

 

Non-compliant Code Example

/* Select all the columns in the customers table */  --Non compliant code (Single line comments starting with /*)
SELECT 
    *       
FROM
    CUSTOMERS

Compliant Code Example

-- Select all the columns in the customers table   --Compliant code (Single line comments starting with --)
SELECT 
    *       
FROM
    CUSTOMERS
Visual Expert 2024
 VEPLSQLRULE112