1.

How do you write comments in a PL/SQL code?

Answer»
  • Comments are those SENTENCES that have no EFFECT on the functionality and are USED for the purpose of enhancing the readability of the code. They are of two types:
    • Single Line COMMENT: This can be created by using the symbol -- and writing what we want to mention as a comment next to it.
    • Multi-Line comment: These are the comments that can be specified over MULTIPLE lines and the syntax goes like /* comment information */
  • Example:
SET SERVEROUTPUT ON; DECLARE -- Hi There! I am a single line comment.var_name varchar2(40) := 'I love PL/SQL' ; BEGIN /* Hi! I am a multi line comment. I span across multiple lines */dbms_output.put_line(var_name);END; /Output:I love PL/SQL


Discussion

No Comment Found