Pages

Hello PL/SQL by DBMS_OUTPUT

I'm using Oracle SQL Developer (OSD), connected to Oracle 11, and I would like just to say hello.

Actually, being OSD a graphical version of SQL*Plus, we can use the its PROMPT command
PROMPT hello
But we want to say hello in a PL/SQL fashion, so we use the DBMS_OUTPUT package.

It is all quite simple, we just have to remember that the DBMS_OUTPUT package to issue the command SET SERVEROUTPUT ON to actually see the output.

OSD makes available a window just for DBMS_OUTPUT, called DBMS Output Pane. If you use it, you should click on the green plus on the left to set server output on for your connection.

When we are ready, we can finally say hello in a PL/SQL block:

begin
dbms_output.put_line('hello');
end;

No comments:

Post a Comment