sqldeveloper - DBMS_OUTPUT.PUT_LINE() Doesn't Work

筅森魡賤 提交于 2019-11-30 20:36:17

问题


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.

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.


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/49803808/sqldeveloper-dbms-output-put-line-doesnt-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!