2

I am trying to print the value passed to the DBMS_OUTPUT.PUT_LINE() function to the DBMS_OUTPUT screen in SQL Developer. No matter what I pass to the function, nothing gets printed in the output window.

I have turned on the DBMS Output window and even connected with an available connection. But on running the following script, only "PL/SQL procedure successfully completed" gets printed in the Script Output window, nothing in the Dbms Output window.

Also I have set the buffer size to 30000, which I guess is enough for printing the string 'test'. Running the command set serveroutput on also didn't work.

Cannot get to print!

When I try the same script in SQLPlus in the command prompt, it works fine and prints 'test' before printing "PL/SQL procedure successfully completed".

Kindly help. Thanks.

Neil
  • 301
  • 2
  • 5
  • 14
  • I even tried reinstalling the application and restarting my PC for the sake of it :( – Neil Apr 12 '18 at 18:42

3 Answers3

12

Upon going through the Oracle community forums, I learned that SQL Developer 17.x which I am using does not provide support to Oracle 10g.

Older version of the SQL Developer 4.x will support Oracle 10g and retrieve DBMS_OUTPUT buffer to display it on the screen.

Since I only had a small database set up for my homework and did not want to downgrade to an older SQL Developer, I upgraded to Oracle 11g XE and it worked. All input given to DBMS_OUTPUT.PUT_LINE() procedure now appears in the Dbms Output window.

Neil
  • 301
  • 2
  • 5
  • 14
3

The last pane on your screen is "Dbms Output". Click the green "+" sign in its toolbar, and then execute the BEGIN-END block again.

Littlefoot
  • 131,892
  • 15
  • 35
  • 57
  • I have already connected the Output window with my db connection and ran the script. It doesn't seem to print. – Neil Apr 13 '18 at 03:33
  • I think you didn't understand what I'm saying (and I can't upload images - company policy). I'm not talking about the "+" sign in the upper left corner of the SQL Developer window, which enables you to create new connections - I'm talking about the "+" sign in the upper left corner of the **Dbms Output** pane (that would be somewhere down & in the middle of the whole SQL Developer window). – Littlefoot Apr 13 '18 at 05:53
  • Oh no I understood what you meant, as you can see in the image, the output window has a tab with the same name as that of the connection which I got by pressing the green plus in the Dbms Ouput window. – Neil Apr 13 '18 at 07:03
  • Too bad; I was hoping that it would help. No further ideas, sorry. – Littlefoot Apr 13 '18 at 07:29
1

I add this answer to help others if they come across this S.O question.

I struggled also with printing DBMS_OUTPUT on SQL Developer so I put this helpful link that I found explaining very well how the mechanism works

https://www.thatjeffsmith.com/archive/2012/03/dbms_output-in-sql-developer/

Dharman
  • 30,962
  • 25
  • 85
  • 135
S_intg
  • 182
  • 1
  • 10