-1

I am not able to see the results by using Dbms_Output.Put_Line in sql developer. The result is shown only once. When I execute it again, it is not shown. I checked a lot of workarounds described in google, but those haven't worked for me.

I am executing following:

set serveroutput on;

BEGIN

 Dbms_Output.Put_Line('hello1');

END;

It should print 'hello1', everytime it executes, but instead, it does so only during first run. I have also tried the only resolution available on google: Opening the 'view' menu and clicking on 'dbms output'. I got a dbms output window at the bottom of the worksheet. I then added the connection by clicking on plus sign appearing in window. But even that did not work for me. Please can anyone help me here?

Noel
  • 10,152
  • 30
  • 45
  • 67
getshere
  • 15
  • 6
  • 1
    Works for me.anonymous block completed hello1 anonymous block completed hello1 anonymous block completed hello1 anonymous block completed hello1 anonymous block completed hello1 anonymous block completed hello1 – Rob van Laarhoven May 19 '15 at 09:39
  • What version of SQLDeveloper? – Rob van Laarhoven May 19 '15 at 09:39
  • The version info is : Oracle Database 11g Release 11.2.0.4.0 - 64bit Production – getshere May 19 '15 at 09:47
  • @getshere - that's the database version; what is the SQL Developer *client* version? You can get that from Help->About. (Also, are you sure you aren't seeing new output, but the previous output is just scrolling out of view in the Script Output/Dbms Output windows? What happens if you change the string?) – Alex Poole May 19 '15 at 10:12
  • This is what I got : Java(TM) Platform 1.6.0_20 Oracle IDE 3.0.02.83 Versioning Support 3.0.02.83 – getshere May 19 '15 at 11:48
  • 3.0.02 is pretty old; I don't have a version older than 3.0.04 lying around to verify this on, and that's [from 2011](http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/sqldev30downloads-1525485.html). Are you able to upgrade to [a newer version](http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/index.html)? Current version is 4.1.0, and that certainly doesn't show this behaviour. – Alex Poole May 19 '15 at 11:59

2 Answers2

1

The version your are using, 3.0.02.83, was an early-adopter (i.e. beta) release. There seems to have been at least one known issue with dbms_output in that version, and this looks like an extension of those problems. As noted in comments, the behaviour you are experiencing in that old version isn't reproducible now.

Unless you have a pressing need to be on an old unsupported beta version, you should upgrade to a later release. At the time of writing the current version is 4.1.0.19, and you can get that from the SQL Developer downloads page.

Alex Poole
  • 183,384
  • 11
  • 179
  • 318
0

This version is being used at my workplace and is remotely hosted, so there is a remote possibility that they will upgrade by acting on my advice.

For now I am able to generate output by this simple workaround: To generate the output I have to select and run all the statements(including 'set serveroutput on;') as a whole, every time I need to generate output. Note that executing 'set serveroutput on;' and

BEGIN

 Dbms_Output.Put_Line('hello1');

END;

separately is not working. I need to select the statements at once and run together in one Go. That's the way it is working for me.

J. Chomel
  • 8,193
  • 15
  • 41
  • 69
getshere
  • 15
  • 6
  • You mean selecting everything and clicking 'run statement'? Running as a script doesn't work without selecting it? Good luck getting the upgrade anyway though; make sure you mention you're on the early adopter release (3.0 EA2), not a production release *8-) – Alex Poole May 20 '15 at 06:51