Multi-Line Comments
Instead of commenting single line, we could also set of consecutive lines at ones using multi-line comments in PL/SQL. Multi-line comment in PL/SQL starts with a forward slash and asterisk (/*) and ends with an asterisk and forward slash (*/). Text or code between /* and */ will get ignored by the compiler.
Syntax of Multi-Line PL/SQL Comment
/* Multi line comment starts
. . . continue . . .
. . . continue . . .
. . . continue . . .
Multi line comment ends */
Example 02: PL/SQL Program to illustrate the Multi-Line Comment
/* demonstrate the use of IN parameter in PL/SQL */
delimiter //
CREATE PROCEDURE inProcedure(IN param INT)
BEGIN
/*
using the IN parameter in procedure
adding the 5 to parameter and then printing the result
*/
select param + 5 as result;
END //
DELIMITER ;
Output:
Explanation: Here, we have called the inProcedure(), with passing 23 as a parameter. program is adding 5 to 23 and we are getting results as 28. The Point to note here is that we have used multi-line comments to explain the program.
PL/SQL Comments
PL/SQL is a Procedural Language for SQL language that extends the functionality of the SQL within Oracle Database Management System. Comments can be used to make code more human-readable. It is a kind of note that programmers usually add while writing the code. In this article, We will learn about Comments in detail along with the types and benefits of using Comments.
Contact Us