Follow us: Connect on YouTube Connect on YouTube Connect on YouTube


Sunday, 3 April 2016

Displaying Information from a PL/SQL Block

DBMS_OUTPUT is a package PUT_LINE is a procedure within that package
Displays a message, value of a variable or both on to the screen
Example 1:
DBMS_OUTPUT.PUT_LINE(‘Hello! Welcome to PL/SQL’);
Example 2:
v_ename := ‘Amit’;
 -- where v_name is a local variable declared in the block
        DBMS_OUTPUT.PUT_LINE(‘Employee Name is :’ || v_ename);
Note: The DBMS_OUTPUT package must be enabled before using it by executing  SQL *Plus command SET SERVEROUTPUT ON
Share this article :


  1. Hello Dayakar,

    Thank you! Thank you! Thank you! Your blog was a total game changer!

    About six weeks ago, one of our Subscription databases was compromised as someone had performed a TRUNCATE TABLE on one of the replicated Tables. We managed to repair the damage be recreating the snapshot and reinitialising the Subscription, but no one owned up to carrying out the TRUNCATE.
    Does anyone know if it is possible to capture the following for any database and log it in a Table: -
    1. Date/Time
    2. Database Name
    3. SQL Command
    4. Host name
    5. Login Name
    I have looked at DDL Triggers but there is nothing there.

    It was cool to see your article pop up in my google search for the process yesterday. Great Guide.
    Keep up the good work!


  2. Ni Hau,

    Such vivid info on theDisplaying Information from a PL/SQL Block! Flabbergasted! Thank you for making the read a smooth sail!

    I need to insert 10lakhs record using bulk collect. I got an error in say 96000th record how to solve it????? Using stored procedure and collections
    Kindly share the program if anyone knows.
    Great effort, I wish I saw it earlier. Would have saved my day :)

    Thanks a heaps,

  3. Hello There,

    Zoooooooom! That’s how speedy and easy this read was! Looking forward to more of such powerful content on Displaying Information from a PL/SQL Block !

    I have data in a column

    I need to retrieve values between '#'. I need to get output as below

    var1 = abcd
    var2 = efghi
    var3 = jlmn
    var4 = opqrs

    Similary if column value is


    var1 = abcd
    var2 = efghi
    var3 = jlmnopqrs
    var4 = null

    But nice Article Mate! Great Information! Keep up the good work!

    Thanks and Regards

  4. Oracle apps and Fusion Self Paced Training Videos by Industry Experts. Please Check

  5. Oracle Apps R12 and Oracle Fusion Cloud Self Paced Online Training Videos Published on Udemy with Life Time Access & Live Meeting Support to Clear your Queries. Avail 25% to 80% discount. Please Check for Never Before Offers and Discount Coupon Codes.