PLSQL

PL/SQL Comments

PL/SQL Comments

All the PL/SQL comments are known to be the explanatory statements that are included in the PL/SQL code that we write and also helps anyone reading the source code. All the program languages allow these types of comments. This language supports single-line and also multi-line comments. All the characters that are available inside any comments are then ignored by the PL/SQL compiler. Single line comments starts with the delimiter that is -- double hyphen and also multi-line comments that are then enclosed by the /* and */.

Syntax:

  DECLARE
         -- variable declaration
         Message varchar2(20):= ‘Good Morning!’;
        BEGIN
        /*
        * PL/SQL executable statements(s)
       */
       dbms_output.put_line(message);
END;
/

When we execute the above code at the SQL Prompt, it gives following results – 

Good Morning

PL/SQL procedure successfully completed.