Hello World Program in PL/SQL
Now get ready to know that, How to do Hello world program in PL/SQL programming language. Here’s an example of a simple “Hello World” program in PL/SQL:
1 2 3 4 | BEGIN DBMS_OUTPUT.PUT_LINE('Hello, World!'); END; / |
Explanation:
BEGIN and END: These are used to enclose the PL/SQL block.
DBMS_OUTPUT.PUT_LINE: This built-in procedure is used to print or display the output in PL/SQL. It will print “Hello, World!” message to the console.
The / at the end is used to run the block in some environments like Oracle SQL*Plus or SQL Developer.
Note:- Make sure that the DBMS_OUTPUT is enabled in your SQL environment. In Oracle SQL*Plus, you can enable it by running:
1 | SET SERVEROUTPUT ON; |
Check out our other PL/SQL programs examples