1

I have written a simple PL/SQL command of printing hello world to console but it prints nothing and still message is prompted that PL/SQL procedure successfully completed. I am not able to figure it out as to what to do in this case? Code:

BEGIN

dbms_output.put_line ('Hello World..');

END;

OUTPUT:

MT0
  • 143,790
  • 11
  • 59
  • 117
Heni Mehta
  • 21
  • 2
  • Besides the fact the correct answer was already given, you can also have a look here, maybe this can prevent you always have to add the "set serverouput on": https://stackoverflow.com/questions/10185176/set-serveroutput-on-permanently – Jonas Metzler Apr 21 '22 at 06:19

1 Answers1

2

You're missing the set serveroutput on.

This is what you have:

SQL> begin
  2    dbms_output.put_line('Hello world');
  3  end;
  4  /

PL/SQL procedure successfully completed.

This is what you should have:

SQL> set serveroutput on             --> this
SQL> begin
  2    dbms_output.put_line('Hello world');
  3  end;
  4  /
Hello world                          --> here's the result

PL/SQL procedure successfully completed.

SQL>
Littlefoot
  • 131,892
  • 15
  • 35
  • 57