DECLARE
message varchar2(20):= 'Hello, World!';
BEGIN
dbms_output.put_line(message);
END;
How can I execute above pl/sql program in Oracle SQL Developer. Can any one suggest me?
DECLARE
message varchar2(20):= 'Hello, World!';
BEGIN
dbms_output.put_line(message);
END;
How can I execute above pl/sql program in Oracle SQL Developer. Can any one suggest me?
I have tried following the steps shown in this image. Some steps are excluded but I am sure you will understand when you encounter them.
If you do not see DBMS output just add
set serveroutput on
at the top and execute the statements as a script, you will see the output in "Script output" section.
set serveroutput on
DECLARE
message varchar2(20):= 'Hello, World!';
BEGIN
dbms_output.put_line(message);
END;
Assuming you already have a connection configured in SQL Developer:
View
menu, select DBMS Output
plus
icon, and select your connectionSQL worksheet
First execute 'set serveroutput on' query in worksheet then check in View menu, DBMS output option will appear.
Surround your procedure code accordingly :
create or replace procedure YOUR_TEST as
begin
<proc code here>
end;
/
show errors
Hit the green arrow to compile - you should get the following message :
Procedure YOUR_TEST compiled
Now run it :
exec YOUR_TEST ;
n.b.: env: Oracle 12g, Sql Developer v18.4