sexta-feira, 28 de agosto de 2015

dbms_output.put_line not showing on Oracle Sql Developer

As I started doing some Oracle supports, I had to create a few scripts for testing "stuff". As on T-SQL the PRINT command does the trick, Oracle takes a few more bits of code:

  exec dbms_output.put_line('Your string here')

And guess what, nothing shows on SQL Developer:



As it turns out, the SERVER OUTPUT must be set to on. It's off by default. Nothing is simple enough if Oracle can complicate it, right?

Run the following command:

  SET SERVEROUTPUT ON;
  exec dbms_output.put_line('Your string here')

You can create a script with SET SERVEROUTPUT ON; and set it as your start up scrip in Tools\Preferences\Database, so everytime you connect to a server, the serveroutput is set to ON.



Check out my new book about R Language http://www.amazon.com/dp/B00SX6WA06

2 comentários:

  1. You can also go to View > DBMS Output

    And then add your connection and listen for output

    ResponderExcluir

Leave your comment here!