DEV Community

Pranav Bakare
Pranav Bakare

Posted on

DBMS_OUTPUT.PUT_LINE in PLSQL

In Oracle PL/SQL, the method to print output is using the DBMS_OUTPUT.PUT_LINE procedure. This procedure writes text to the console or output buffer, which can be viewed after execution if DBMS_OUTPUT is enabled. Here’s how you use it:

  1. First, enable output in your SQL environment (like SQL*Plus or Oracle SQL Developer):

SET SERVEROUTPUT ON;

  1. Use DBMS_OUTPUT.PUT_LINE to print output:

BEGIN
DBMS_OUTPUT.PUT_LINE('Hello, World!');
END;
/

This will display:

Hello, World!

Make sure that SERVEROUTPUT is enabled; otherwise, you won't see the output in your console.

Top comments (0)