6 Replies Latest reply: Aug 20, 2013 5:40 AM by makel RSS

    How to get server output in SQL Developer

    BeverlyABeeman-Oracle

      I am learning SQL Deverloper and am using it in a University environment as well as Oracle test instances at Oracle.

       

      I know my way around SQL some but I am just learning PL/SQL.  I want to run an anonymous block and see output for the "dbms_output.put_line" items.

       

      At school, I enter my block in the "SQL Worksheet" and receive the "anonymous block completed" in the "Script Output" screen.  Then there is a 3rd screen, the name of which I cannot remember, but I believe it is the equivalent of "server output".  When I open it I have to tell it which database I'm using.  Then, I see the dbms output lines in this 3rd section.

       

      The problem is when I am using SQL Developer at work, I see only 2 sections:  "SQL Worksheet" and "Script Output".

       

      I have looked but cannot find an option or a button or a window that is called something like "server output" or "view server output."

       

      Can a more experienced user please help me?

       

      I am using:

       

      SQL Developer Version 3.1.07

              Build MAIN-07.42

      Linux x86-64

       

      (Oracle Internal:

      Instance: http://celalnx38.us.oracle.com:10507/

      tnsnames: 10500)

        • 1. Re: How to get server output in SQL Developer
          BeverlyABeeman-Oracle

          ROFL!  So I went back and looked again, just to be sure.... and I found  DBMS OUTPUT on the VIEW menu.  LARGE AS LIFE, but I have never SEEN it there before....

          • 2. Re: How to get server output in SQL Developer
            Gary Graham-Oracle

            Just an FYI.  Dbms_Output has been on the View menu since the 2.1 release.  Prior to that it was hardwired as a sibling tab to Query Results/Script Output for each Worksheet -- but that caused some confusion for worksheets sharing a connection.

             

            -Gary-

            • 3. Re: How to get server output in SQL Developer
              makel

              It is quite confusing when you have several tabs and several connections on the go.  Will this be the same in v4?

              • 4. Re: How to get server output in SQL Developer
                Gary Graham-Oracle

                Hi Makel,

                 

                There are no changes of which I am aware in the Dbms_Output view functionality between the 3.2 and 4.0 releases.

                 

                As to your point about confusion, keep in mind the following:

                1. Each Worksheet tab and Dbms_Output tab include the name of the connection in use.  Match on that name when checking output results.

                2. Opening multiple Worksheets on the same connection name will share one database connection by default.

                3. Multiple Worksheets sharing a database connection also share one Dbms_Output tab.  That is by design.

                 

                To force worksheets to use unshared connections:

                4. Change the default behavior of (2) via Tools -> Preferences -> Database -> Worksheet -> New Worksheet to use unshared connection.

                5. Or avoid (4's) overhead of always using unshared connections by opening one-off unshared Worksheets: Ctrl + Shift + N from a shared Worksheet.

                 

                Finally:

                6. When using unshared Worksheets, one Dbms_Output tab may be opened per unshared Worksheet.  Note that the names of any unshared Worksheets will appear in Dbms_Output's Select Connection dialog drop down list. That should avoid any confusion.

                 

                Hope this helps,

                Gary

                • 5. Re: How to get server output in SQL Developer
                  BeverlyABeeman-Oracle

                  Thank you for these additional details.  They will be helpful to me as I learn SQL Developer.

                  • 6. Re: How to get server output in SQL Developer
                    makel

                    Thanks for all the information.  I prefer unshared connections so it's good to know I can make them the default.

                     

                    I suppose I think of the connection as being the "parent", and the individual worksheets/outputs as "children" of that connection.  Maybe I've been conditioned by using a different tool in the past, but I feel it would be more intuitive if each connection had a window, and all worksheets/etc for the connection were tabs of that window.

                     

                    thanks,

                     

                    M