How to run pl / sql program in oracle sql developer

DECLARE message varchar2(20):= 'Hello, World!'; BEGIN dbms_output.put_line(message); END; 

How can I run on the pl / sql program in Oracle SQL Developer. Can anyone suggest me?

+8
source share
5 answers

I tried to follow the steps shown in this image. Some steps are excluded, but I'm sure you will understand when you come across them. screenshot

+19
source

If you do not see the DBMS output, just add

 set serveroutput on 

at the top and execute the instructions as a script, you will see the output in the "Script output" section.

 set serveroutput on DECLARE message varchar2(20):= 'Hello, World!'; BEGIN dbms_output.put_line(message); END; 
+15
source

Assuming you already have a connection configured in SQL Developer:

  • From the View menu, select DBMS Output
  • in the DBMS Output window, click the green plus icon and select a connection
  • right-click the connection and select SQL worksheet
  • insert your request into the sheet
  • fulfill the request
+3
source

First, run the query "set serveroutput on" on the sheet, then check the "View" menu, the DBMS output option will appear.

+2
source

Surround your procedure code accordingly:

 create or replace procedure YOUR_TEST as begin <proc code here> end; / show errors 

Click the green arrow to compile - you should receive the following message:

 Procedure YOUR_TEST compiled 

Now run this:

 exec YOUR_TEST ; 

nb: env: Oracle 12g, Sql Developer v18.4

0
source

Source: https://habr.com/ru/post/952583/


All Articles