Serveroutput in the command window of PLSQL Developer

In sqlplus, I input the following SQL:
SQL> set serveroutput on
SQL> show serveroutput
serveroutput ON SIZE UNLIMITED FORMAT WORD_WRAPPED
SQL> select /*+ no_index(t1 idx_t1) */ * from t1 where n=3;
     N
     3
SQL> select * from table(dbms_xplan.display_cursor(null,null,'advanced'));
PLAN_TABLE_OUTPUT
While I input the same SQL in PLSQL Developer:
SQL> select * from table(dbms_xplan.display_cursor(null,null,'advanced'));
PLAN_TABLE_OUTPUT
SQL_ID     9babjv8yq8ru3, child number 0
BEGIN DBMS_OUTPUT.GET_LINES(:LINES, :NUMLINES); END;
NOTE: cannot fetch plan for SQL_ID: 9babjv8yq8ru3, CHILD_NUMBER: 0
Please verify value of SQL_ID and CHILD_NUMBER;
It could also be that the plan is no longer in cursor cache (check v$sql_plan)
And the most important is:
SQL> show serveroutput
SQL>
The result of it is empty.
The reason for that is serveroutput is only supported in sqlplus not PLSQL? I know serveroutput is sqlplus language not SQL. However I use "show serveroutput" in command window of PLSQL Developer which is the same as sqlplus. What's the real reason for that?
Thanks for your kindly reply.

" If serveroutput is on when you call this function, the last statement you will have run will be the (hidden) call to dbms_output that follows your execution of any other statement – so you won’t get the plan and statistics."
http://jonathanlewis.wordpress.com/2006/11/09/dbms_xplan-in-10g/
"Luckily I recognized the line BEGIN DBMS_OUTPUT.GET_LINES(...); END; from the tkprof output files. It is what SQL*Plus does after each statement: flushing the dbms_output buffer to the screen. To have the dbms_xplan.display_cursor show what I want, I started writing a little script against V$SQL to get the latest "real" SQL-statement, but then I realised I cannot possibly be the first to encounter this problem. Googling led me to this very useful blog entry by Jonathan Lewis. It contains almost everything you want to know about the display_cursor function. A simple "set serveroutput off" is enough to get the function working! "
http://rwijk.blogspot.nl/2008/03/dbmsxplandisplaycursor.html
So, actually you should have set serverout off.
Probably also depending on how you're gathering the execution plan statistics (you're not using the gather_plan_statistics hint?) and the SQL*Plus version and database version you're working with...

Similar Messages

  • How to get rid of the command window....

    How to get rid of the command window, automatically, once the .bat file which execute the .jar has been executed?
    Znx

    If you don't want the command window to show, use:
    javaw yourClass
    instead of...
    java yourClass

  • How do I keep the command window open?

    I want to write a batch file that will leave the window open after running so I can see what the output is.
    I kind of remember having to use %k
    But I'm not sure exactly how to do it.
    UPDATE: I found what I was looking for, it's /k when you execute the command file.
    If anyone has any additional comments about scripting and keeping the command window open, please comment.

    Add "pause" to the end of the batch.
    ¯\_(ツ)_/¯

  • To exit the command window after  weblogic app server startup

    Hi,
    The startWeblogic.cmd starts the weblogic V 10.0 server without exiting the prompt. Since our requirement wanted the startWeblogic script to exit the window after server startup, we set the parameter SET doExitFlag=true in startweblogic.cmd file , but the result was same as earlier the server started without exiting the window. Also we tried Redirecting the server starup output to a file , but even this did not exit the window.
    My query is
    1. What parameter options one should use to start the server so that it exits the command window in which it was started?
    2. Is there an alternate way to do the same,something like to start it as a background process in Windows?
    Any help in this regard would be great.
    Thanks in Advance.
    Best Regards,
    Preethi

    Not sure about parameters to startWeblogic.cmd, but from Windows you could
    try
    start /b startWebLogic.cmd > start.log 2 >& 1
    <Preethi Ghalke> wrote in message news:[email protected]..
    Hi,
    The startWeblogic.cmd starts the weblogic V 10.0 server without exiting the
    prompt. Since our requirement wanted the startWeblogic script to exit the
    window after server startup, we set the parameter SET doExitFlag=true in
    startweblogic.cmd file , but the result was same as earlier the server
    started without exiting the window. Also we tried Redirecting the server
    starup output to a file , but even this did not exit the window.
    My query is
    1. What parameter options one should use to start the server so that it
    exits the command window in which it was started?
    2. Is there an alternate way to do the same,something like to start it as a
    background process in Windows?
    Any help in this regard would be great.
    Thanks in Advance.
    Best Regards,
    Preethi

  • Changing the title of the Command Window

    How do i change the title of the command window form "C:\Programs\jdk1.2.1\bin..." etc to something more useful like "MyProgram"?
    Many thanks
    Cath

    What I amproposing is that if we all merge on the same chapter and examples then we can ask each other specific questions and all have the same benchmarrk and reference points!!
    I plan to advertize this on other lists and if we all use the same text then we are all the much further ahead instead of having questions from all sorts of text and nobody knowing what the other is doing and having completely different code and examples!!
    What do yu guys think?
    Personally, I am in chapter 8 just staring SWING. But I don't mind going back to the first part to help othere newbies (as long as we have the same text and the examples are from the text).
    For example, I have modified example 8-1, so that instead of just showing colors in the background, the buttons show a photo with text, shows text and changes the background, and will do something else ( don't know what yet)! But the whole thing is still based on the example code on page 323.
    I had some problems trying to figure how to do this... but if we all work on projects that are based on the code examples for the same text, we stand a better chance of all learning faster...
    So Yes, it is a study group using emails or chats...forum.
    The main difference is that if a person needs help we can all share code with them (NOT NECESSARILY DOING THE PROJECT...unless you wan to) but with the same book {Core Java2-Fundamentals or Core Java2- Advanced Programming} and with the help of at least one senior programmer that we have on the thread already ... with the otheres like you that want to join...all using the same book....Then no matter what project you are working on (from the book or work or school) we all have the same text to help each other and to reger each other to.
    Moreover, there never need to be another instance where the answer comes back: "read the tutorial" or check the docuemtation.... Those are good answers if you know what you are lloking for...but sometimes a person may need an example in working code.... and the tutorials don't answer specific questions where a person may not quite understand.
    So,
    why not stop by the New Study group that is going?...you can find us in forum New To Java Technology
    under the thread of "is anyone learning Java using the Sun Microsystems book...."
    In the meantime.... the person that was asking for hel here has not posted anything ... So I wonder if she realy wanted help?
    I will hang out here fopr another day or so and see if she answers my questions to her .. If nt then i will assume that this is a dead thread and I will no longer be here. You know where you can find me....
    phil

  • Where do I find the Command-line Adobe AIR Developer Tool?

    Hi,
    Where do I find the Command-line Adobe AIR Developer Tool? (ADT)
    I downloaded the AIR 4 SDK, but can't find it.
    Thanks

    Yes, as Colin stated, FB / FlashPro calls it with app-xml and some other (device orientation, width, height etc) parameters.
    // chall3ng3r //

  • NOT displaying the command window when running applications

    hi
    i'v been seraching all over the web for a way to get rid of the command window (dos shell) that appears when running a java swing based application (or any other). i currently have a batch file that loads all the required libraries into the class path and then calls the application's main class. problem is, the DOS command window stays open. is there any way to have it not display (obviously without losing my program in the process). at the very least can it be minimised automatically (just the dos window)?? though i think getting rid of it all together would be best.
    i would really love some help on this... very over seeing that dos window displayed...
    any help would be greatly appreciated.... thanks heaps
    Takis

    On Win NT
    REM get rid of commnand window
    start /B java swingapp
    REM minimize the command window
    start /MIN java swingapp
    REM for other options
    help start
    Hope this helps,
    Sathish.
    hi
    i'v been seraching all over the web for a way to get rid of the command window (dos shell) that appears when running a java swing based application (or any other). i currently have a batch file that loads all the required libraries into the class path and then calls the application's main class. problem is, the DOS command window stays open. is there any way to have it not display (obviously without losing my program in the process). at the very least can it be minimised automatically (just the dos window)?? though i think getting rid of it all together would be best.
    i would really love some help on this... very over seeing that dos window displayed...
    any help would be greatly appreciated.... thanks heaps
    Takis

  • Run a jar on Windows without the command window

    I would like to run a jar and close the command window after starting up. Is this possible please.

    I would like to run a jar and close the command window after starting up. Is this possible please.why do you want to do that? jar files are executable files so when you double click it, it will execute without having to run it from the command prompt. So, you don't have to even open the cmd prompt to run .jar files.

  • Eliminating the Command window in Windows

    I had thought I had found a way to make the command window (the black command interpreter window in Windows that comes up when you run the JVM) go away. I used the following code:
    public class StartApp {
         public static void main( String[] args ) {
              String command = "java";
              for ( int n = 0; n < args.length; n++ )
                   command += " " + args[n];
              if ( args.length > 0 ) {
                   try {
                        Runtime.getRuntime( ).exec( command );
                        System.exit( 0 );
                   catch ( Exception e ) {
                        System.err.println( e );
                        System.exit( 1 );
              else
                   System.out.println( "Format: java StartApp [-options] <filename> [arguments]" );
              System.exit( 0 );
    When I run this Java app and put in another app for it to run, it runs that app just fine (it's a Swing app so I don't need the command window visible). Not only that, but it gives me the command line right after starting it (meaning the original app exited). So, theoretically, you would think I could just type "exit" to close the command window. Well, when I do type that, the command window waits until the program exits before actually closing. Manually closing the command window closes the whole program. The odd thing was, an older version (I think Java 1.1) of the JRE would allow the command window to close. But, with 1.3, it does not. Does anyone have any idea about how I could change this, or of another way to get rid of the command window?
    -Sam Fahmie

    Sorry, didn't put the code tag in right...
    public class StartApp {
         public static void main( String[] args ) {
              String command = "java";
              for ( int n = 0; n < args.length; n++ )
                   command += " " + args[n];
              if ( args.length > 0 ) {
                   try {
                        Runtime.getRuntime( ).exec( command );
                        System.exit( 0 );
                   catch ( Exception e ) {
                        System.err.println( e );
                        System.exit( 1 );
              else
                   System.out.println( "Format: java StartApp [-options] <filename> [arguments]" );
              System.exit( 0 );

  • Can the command window go away?

    We're upgrading from 6.0 to 6.1 and on our Windows development machines, the new version pops open a command window, which we can't seem to make go away.
    This didn't happen in 6.0, and they're kind of annoying. How can we get the 6.1 server to start without opening a command window?

    The easiest way to stop this is to go into the Services tool for Windows and uncheck the "Interact with desktop" option for the Web Server service. If this is on Win2k this is under the "LogOn" tab.
    --jb                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Labview code for closing the command window

    Hi,
    This is naveen.Actually we are using 3rd paty test software for our mobile hardware testing which creates an DOS or Command window after execution.We have automated to execute this software using labview.the problem we facing is that we couldn't run the test software unless we close or kill the dos window opened in the previous run.So i like to know whether you have any labview code for closing or killing the DOS window ,i request you help me in this regard.
    regards,
    Naveen 

    Use the System Exec VI Owning Palette: Libraries & Executables VIs and Functions.
    And take a look here http://www.tech-recipes.com/rx/446/xp_kill_windows_process_command_line_taskkill/
    Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
    (Sorry no Labview "brag list" so far)

  • Output to command window using PLSQL

    How can I output variables in PLSQL to log or cmd?
    thanks

    Yes, DBMS_OUTPUT.GET_LINE() can be called. The following code illustrates one approach to reading data from the DBMS_OUTPUT buffer.
    SQL> -- to prevent SQL*Plus from interfering
    SQL> set serveroutput off
    SQL>
    SQL> begin
    2 DBMS_OUTPUT.Enable;
    3
    4 DBMS_OUTPUT.put_line( 'What do you want, universe?' );
    5 end;
    6 /
    PL/SQL procedure successfully completed.
    SQL>
    SQL>
    SQL>
    SQL> create or replace type TStrings is table of varchar2(4000);
    2 /
    Type created.
    SQL>
    SQL>
    SQL> create or replace function GetLine return TStrings pipelined is
    2 status integer;
    3 line varchar2(4000);
    4 begin
    5 loop
    6 DBMS_OUTPUT.get_line( line, status );
    7 exit when status = 1;
    8 PIPE ROW( line );
    9 end loop;
    10 return;
    11 end;
    12 /
    Function created.
    SQL> show errors
    No errors.
    SQL>
    SQL>
    SQL> select * from TABLE(GetLine);
    COLUMN_VALUE
    What do you want, universe?
    SQL>

  • Output plsql variable to command window

    I am executing a PLSQL stored procedure from my java class. I want to know how to output a variable within the PLSQL to the command window?
    thanks

    I don't understand the question. Are you telling us you don't understand how to use System.out.println(...);? How do you debug programs without using this method?
    Usually the first program someone learns to write is something like:
    public static void main(String[] args)
        System.out.println("Hello World");
    after they press "current status" or if they "delete" their current itemsYou want to do some activity when the above actions occur. You must already have code in your program to do something in the above cases. So simply add the System.out.println(..) statements in the same part of code.

  • Supressing the Java command window ???

    Hi,
    How do I get rid of the command window from where I start my Java Application ?
    Even if there is a way what will happen to all the System.out.println() calls in my applicatio ?
    Thanks in advance.

    You can just not start the Java application from a command window or batch file. The easiest way to do this is to create an executable JAR file which a person (on Windows) can just double-click. Do a search on "executable JAR".

  • Again...Suppressing the Java Command Window

    Hi,
    My invoking my java application with "javaw", I'm able to suppress the command window.
    None of the System.out.println() is now seen. Thanks for that.
    But there is another problem that I see.
    In my application, I run some batchfiles using the Runtime.exec
    with the "cmd" parameter. This is making a separate command window
    pop up from no where.
    This pop up is happening for every call I make ? Can this be avoided at all ???
    Or should I live with it ??
    Many Thanks

    You may have to live with that cause cmd runs with its own window. I haven't used this very much but for the little I have done, I can't ever seem to get it to hide, unless you decide to use START to run the activity and then call EXIT in the batch file so it closes as soon as it is done.
    ICE

Maybe you are looking for