SPOOL Command in PL/SQL developer

Hi,
Iam executing below command in PL/SQL Developer7.0
SPOOL 'U:/MyFiles/test.txt';
select sysdate from dual;
spool off;
Iam getting ORA-00900: Invalid SQL Statement. Please let me know what is the exact syntax for SPOOL in PL/SQL Developer.

Hi;
Please see below note which is mention to using of spool wiht example:
http://www.scribd.com/doc/4542950/How-to-Spool-in-Oracle
http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/ch12043.htm
http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:1317802337341
spool sql*plus's output
Regard
Helios

Similar Messages

  • Is Sql plus command avaliable in sql developer

    SQL developer is able to do most of thing can be done with sql plus with GUI , cool.
    However, seems sql command, such as show parameter, start database have to be done in sql plus.
    is this true?
    most of time in my development, I just open sql developer now. but seems in this statuation, i have to use sql plus.

    jz2 wrote:
    SQL developer is able to do most of thing can be done with sql plus with GUI , cool.
    However, seems sql command, such as show parameter, start database have to be done in sql plus.
    is this true?
    most of time in my development, I just open sql developer now. but seems in this statuation, i have to use sql plus.As far as I know you still have to start the database from SQL*PLUS. If your schema has privileges you can get parameter values in SQL*Developer by querying V$PARAMETER (SET_CATALOG_ROLE privilege).
    The two tools are not the same. Much of what you can do with SQL*PLUS you can do with SQL*Developer but I feel that SQL*PLUS still has better scripting abilities along with its bind variable storate. On the other hand the GUI interface of SQL*Developer Is fairly easy to use. The danger is editing procedures/functions/packages in the database forgetting to back them up from SQL*Developer first; SQL*PLUS forces me to use scripts.
    Depending on what I am doing I use either SQL*PLUS or SQL*Developer (which I like better for queries with long select lists).
    I'm having trouble getting DBMS_OUTPUT.PUT_LINE to work the way I expect in SQL*Developer; sometimes the output just does not appear without repeated executions of the generating program.

  • Run command line with SQL Developer

    Is is possible to run SQL Developer in command line mode?
    As SQL Developer is a unicode client to unicode database, it will be a good news for me. It is possible to run batch using SQL Developer to edit the database.

    Take the suggestions from SQL Developer from the command line , to which I can add you could use $SQL_PATH/login.sql or the same file located in your specified script dir, which will be called on making a connection.
    If you don't vote for the feature request at the SQL Developer exchange, don't be surprised no progress is being made...
    K.

  • Use "set spool" command in pl/sql block

    Hi,
    I need to use the "set spool ..." command inside my pl/sql block.
    could you please tell me how to do this.
    Please help fast.
    Thanks
    Maria

    I am aware that spool is not a pl/sql command.
    I have to put the result of my query into a file without using util commands ( as I canot change the utl_file_dir). SO I was sondering if somehow I could use the pool command inside my pl/sql.
    My data is too big to use dbms_output.
    Thus can you suggest anything

  • Using the equivalent of a BREAK ON command in SQL Developer SQL window

    Folks.
    In SQL*PLUS "BREAK ON Col1 ON Col2;", I can generate a report similar to the following:
    Col1Value1 Col2Value1 Col3Value1
    Col3Value2
    Col3Value3
    Col2Value2 Col3Value1
    Col3Value2
    Col3Value3
    Col1Value2 Col2Value1 Col3Value1
    Col3Value2
    Col3Value3
    Col2Value2 Col3Value1
    Col3Value2
    Col3Value3
    etc.
    I want to be able to do the same thing in my SQL Developer SQL window so that I can export the results to a spreadsheet file.
    Does anyone know if this is possible?
    I've tried using the SQL*PLUS BREAK command in my SQL Developer window but it appears to be ignored. My resultset looks something like
    Col1Value1 Col2Value1 Col3Value1
    Col1Value1 Col2Value1 Col3Value2
    Col1Value1 Col2Value1 Col3Value3
    Col1Value1 Col2Value2 Col3Value1
    Col1Value1 Col2Value2 Col3Value2
    Col1Value1 Col2Value2 Col3Value3
    Col1Value2 Col2Value1 Col3Value1
    Col1Value2 Col2Value1 Col3Value2
    Col1Value2 Col2Value1 Col3Value3
    Col1Value2 Col2Value2 Col3Value1
    Col1Value2 Col2Value2 Col3Value2
    Col1Value2 Col2Value2 Col3Value3
    .

    OK thanks.
    I did get around this by using SQL*PLUS to generate an output file with a separation character between the columns and spooling the SQL*PLUS output to a text file.
    I then open the text file with Excel and specify the same character as a column separator. Seems to load properly into Excel.

  • SQL Developer crashing when opening or testing a connection

    SQL Developer closes abruptly when opening or testing a connection.
    Here's what I do.
    Open SQL Developer.
    Create a connection:
    Connection Name: [some string]
    Username: [username]
    Password: [password]
    Save password: checked
    Oracle tab:
    Connection type: TNS
    Connect Identifier: somedatabasename
    Then I click on "Test" and the application immediately quits. No error messages. The app does the same thing if I save the connection and try to expand its node on the list of connections.
    Mind you, if I use sqlplus like so:
    [username]/[password]@somedatabasename
    It connects just fine.
    I captured the output from the command console after SQL Developer crashed:
    Microsoft Windows [Version 6.1.7601]
    Copyright (c) 2009 Microsoft Corporation. All rights reserved.
    C:\Oracle\product\sqldeveloper\sqldeveloper\bin>sqldeveloper
    _execv() failed, err=2Registered TimesTen
    # A fatal error has been detected by the Java Runtime Environment:
    # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000006d9f97c5, pid=5480, t
    id=5840
    # JRE version: 6.0_43-b01
    # Java VM: Java HotSpot(TM) 64-Bit Server VM (20.14-b01 mixed mode windows-amd64
    compressed oops)
    # Problematic frame:
    # V [jvm.dll+0x1397c5]
    # An error report file with more information is saved as:
    # C:\Oracle\product\sqldeveloper\sqldeveloper\bin\hs_err_pid5480.log
    # If you would like to submit a bug report, please visit:
    # http://java.sun.com/webapps/bugreport/crash.jsp
    I am using:
    sqldeveloper 3.2.20.09.87 (64-bit)
    Java 1.6.0_43 (64-bit)
    Windows 7 Enterprise SP1 (64-bit)
    ODAC 11.2.0.3.20 x64
    Please help!
    Edited by: 993662 on Mar 13, 2013 9:10 AM

    @Jim:
    Thanks for your suggestion. After several hours of experimenting, I've managed to fix my problem by copying the ojdbc6.jar from my ODAC installation and replacing the one in [sqldeveloper root]\jdbc\lib
    To whomever has a similar issue: See my original post for what software I was using and their version numbers.
    Edited by: FrostyZoob on Mar 14, 2013 8:11 AM

  • Can't create connection in SQL developer

    hi,
    i download sql developer from oracle website but when i want to start and start it with making new connection it always give me error saying
    test faild IO error: the network adapter could not estabilished a connection
    please help
    i am using windows vista 32bit OS

    Hi Saqid,
    If you performed a default Oracle 10g Express Edition installation on your local machine, then you should find something like the following:
    Services:
    OracleXEService Started Automatic
    OracleXETNSListener Started Automatic
    TNSNAMES.ORA file entry:
    XE =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = XE)
    You should be able to do the following from a Windows command prompt and get similar results:
    C:\>sqlplus /nolog
    SQL*Plus: Release 10.2.0.1.0 - Production on Mon Jul 25 14:53:17 2011
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    SQL> conn system
    Enter password:
    Connected.
    SQL>
    SQL> quit
    Disconnected from Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
    C:\>
    C:\>tnsping xe
    TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on 25-JUL-2011 14:22:35
    Copyright (c) 1997, 2005, Oracle. All rights reserved.
    Used parameter files:
    C:\oraclexe\app\oracle\product\10.2.0\server\network\admin\sqlnet.ora
    Used TNSNAMES adapter to resolve the alias
    Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)
    (PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = XE)))
    OK (50 msec)
    When your installation works correctly for these commands, then the SQL Developer connection should work as well.  If not, please provide specific installation and machine details.  But first you need to verify using sqlplus and tnsping that the 10g installation is working correctly.  If not, then please post to the appropriate forum for help in that area.
    Regards,
    Gary Graham
    SQL Developer Team

  • SQL developer wont start on Mac OSX Lion

    Hi there,
    hoping someone can help me with this one, I've been running SQL Developer 3 on the macbook no problems for about a year, I recently upgraded to Mac OSX Lion and now when I try to start SQL Developer it will not run.
    I have downloaded and installed the latest version of java as directed on the SQL Developer download page.
    When I start SQL developer and view the Activity Monitor the "bash" process starts to use 100% CPU very quickly and SQL developer does not even get to the splash screen.
    Can anyone point me in the right direction in terms of diagnosing this issue? Is there a log file I can review or way of starting SQL developer with specific arguments?
    Kind regards,
    stu

    Irian wrote:
    Usually the SetJavaHome points to the root directory for the JVM installation, this directory in your case appears to be
    /Library/Java/JavaVirtualMachines/1.6.0_26-b03-383.jdk/Contents/Home
    so try setting this in the SetJavaHome command for your SQL Developer (the bin folder will be added internally)
    I'm not completely sure as i do not use macs, but it's worth a try.
    Just had this same problem with Mountain Lion/SQL Developer 3.2.2, right after my upgrade to Mountain Lion. The path shown in Irian's response is what did the trick for me. The /System/Library/.... path shown by some others doesn't even exist on my machine. Interesting....
    Earl

  • Spool command in SQL Developer 3.1

    Hi,
    I am using sqldeveloper-3.1.05.97 .
    There are few scripts that I need to run on a EBS sandbox to generate txt files for a analysis tool input .
    The script is meant to be run with SQL * Plus but I am getiing a TNS listener error due to which I want to use SQL Developer.
    The Spool command is able to create file in local directory but the oputput is not the query result but the query itself. Please help if anything is wrong in the syntax below:
    ALTER SESSION SET NLS_DATE_FORMAT = 'MM/DD/YYYY';
    SET NEWPAGE 0
    SET SPACE 0
    SET PAGESIZE 0
    SET ECHO OFF
    SET FEEDBACK OFF
    SET COLSEP |
    SET MARKUP HTML OFF
    SET LINESIZE 600
    SPOOL FND_USER.txt
    SELECT USER_ID, USER_NAME, LAST_UPDATE_DATE, LAST_UPDATED_BY, CREATION_DATE, CREATED_BY, START_DATE, END_DATE, DESCRIPTION, LAST_LOGON_DATE, PASSWORD_DATE, PASSWORD_ACCESSES_LEFT, PASSWORD_LIFESPAN_ACCESSES, PASSWORD_LIFESPAN_DAYS, EMPLOYEE_ID, CUSTOMER_ID, SUPPLIER_ID
    FROM APPS.FND_USER;
    SPOOL OFF

    Hi Partha,
    It seems the line "SET PAGESIZE 0" is suppressing all output in SQL Developer, and not just "all headings, page breaks, titles, the initial blank line, and other formatting information" as documented for SQL*Plus. Keep in mind that SQL Developer does not yet provide full support for all SQL*Plus formatting commands. For example, without SET PAGESIZE 0, the script output tab shows these messages:
    line 2: SQLPLUS Command Skipped: set NEWPAGE 0
    line 3: SQLPLUS Command Skipped: set SPACE 0
    line 8: SQLPLUS Command Skipped: set MARKUP HTML OFF
    I will log a bug for this.
    Regards,
    Gary
    SQL Developer Team

  • SQL Developer 1.5.5   SPOOL command

    Hello,
    I have a question to SQLplus command SPOOL
    Testsetting:
    SQL Developer 1.5.5_5969
    Oracle 10g Release 10.2.0.3.0
    The output from SPOOL in the log file is only a subset from what I get in the Script Output Panel.
    I don't see the SQL Error Message and the number of rows selected or updated. See the scenario below.
    Does anybody know, how I can get the whole output to the log file?
    Testcase: Start ScriptRunner (F5)
    =================================
    SET ECHO ON
    SPOOL C:\tmp\test.log
    SET SERVEROUTPUT ON
    SET FEEDBACK ON
    WHENEVER SQLERROR EXIT ROLLBACK
    select lcode from test_table;
    update test_table set lcode = NULL where 1=2;
    update test_table set lcode == NULL where 1=2;
    SET SPOOL OFF
    EXIT
    A.) Output from ScriptRunner (F5) at Script Output Panel:
    =========================================================
    SET ECHO ON
    SPOOL C:\tmp\test.log
    SET SERVEROUTPUT ON
    SET FEEDBACK ON
    WHENEVER SQLERROR EXIT ROLLBACK
    select lcode from test_table
    LCODE
    GL
    GL
    SK
    3 rows selected
    update test_table set lcode = NULL where 1=2
    0 rows updated
    update test_table set lcode == NULL where 1=2
    Error starting at line 3 in command:
    update test_table set lcode == NULL where 1=2
    Error at Command Line:3 Column:28
    Error report:
    SQL Error: ORA-00936: Ausdruck fehlt
    00936. 00000 - "missing expression"
    *Cause:   
    *Action:
    Rollback
    B.) Output from SPOOL in log file:
    ==================================
    SET SERVEROUTPUT ON
    SET FEEDBACK ON
    WHENEVER SQLERROR EXIT ROLLBACK
    select lcode from test_table
    LCODE
    GL
    GL
    SK
    update test_table set lcode = NULL where 1=2
    update test_table set lcode == NULL where 1=2
    Thanks
    Markus

    The connections are in
    C:\Documents and Settings\Application Data\SQL Developer/system1.5.0.53.38/o.jdeveloper.db.connection.11.1.1.0.22.49.35/connections.xml
    If you want to back them up, you can just right-click export from the tree.
    -kris

  • SPOOLing in sql developer does not take into consideration SET ECHO OFF

    I'm running SQL Developer 3.1.07.42 on Windows 7 64 bit with java 1.7
    I have the following very simple script just to show the problem:
    SET ECHO OFF;
    SET FEEDBACK OFF;
    SET SERVEROUTPUT ON;
    SET VERIFY OFF;
    SET PAGES 0;
    SET HEAD OFF;
    SPOOL c:\test.sql
    SELECT 1, 2, 3 FROM DUAL;
    SPOOL OFF;
    /if I run it in TOAD 10.6.0.42 it creates the file with
             1          2          3This is as expected (by me)
    if I run the exact same query in SQL Developer 3.1.07.42 , it creates the file with:
    < SELECT 1, 2, 3 FROM DUAL
    1 2 3(the < above is actually ">" but the CODE formatting software is screwing ">")
    but I don't want the ECHOed command to be spooled. For the life of me, I cannot find a way to disable the ECHO from spooling in sql developer.
    Tried the same in 3.0.4 and 2.1.1 with the same (bad) result (plus some warning on some of the unsupported SET commands).
    Am I missing something obvious? Cause like this, the spool command cannot be used in sql developer to generate a CSV file for example, because of the echoed command. And windows doesn't come with SED by default so that is out. (plus that my original script is integrated into a much larger and complex set of scripts and the main script using them is executed from SQL Developer as a company policy (so that everybody uses the same tool and the code runs the same for everybody))
    Any ideas/suggestions are welcome
    Thanks.

    Hi Gary, you seem to have some extensive knowledge. I'd like to follow-up on this thread and try to understand why SQL Developer won't hide the code even though I'm already running the code as a Worksheet (I assume you mean Run Script F5 button in SQL Developer).
    I generally develop in SQL Developer that does a lot of dbms_output to echo data using a Spool command. When I'm in SQL Developer I can't get the code NOT to spool, it typically is echoed directly in the spool file at the top followed by the dbms_output data. If I save the sql file and run in in sqlplus it only outputs the data (good). If I use @C:\xyz_script.sql and hit F5 in SQL Developer it only outputs the data (per your previous answer) -- good.
    So why can't I hit F5 in SQL Developer in the script file and have it only output the data? It just doesn't work no matter how many "SETs" you turn-off.
    Looks like Echo, Term, Feed are supported in SQL Developer, maybe supported means something other than work.
    http://www.oracle.com/technetwork/developer-tools/sql-developer/sql-worksheet-commands-097146.html

  • Does SQL Developer allow file spooling?

    Hello, I'm asking whether SQL Developer application allows me to use the spool command to save all the queries I entered during a session into a text file, just like we used to do in sqlplusw.exe, so that they can be used for reference? or do we have to save each single query we enter?

    You can also select All in the output windows. Then you can right click to export the data from the output in several format.
    Regards

  • Spool from SQL Developer 2.1

    Hi all, i have various scripts that use spool to write results to text files. When i run these scripts i get errors for commands like "spool" and "prompt". It's possible to run this scripts and generate spools from my SQL Developer 2.1? Thanks in advance.

    We've found that scripting in SQL*PLUS is easier for us. Of course, we've been using it for years and years ...
    Evita pointed out that SQL*Developer's scriptiing capabilities are more limited than SQL*PLUS'. You can simulate spooling by executing the query(queries) as a script in the SQL worksheet and then saving the output pane.
    Athough the prompt command probably won't work in SQL*DEVELOPER you can still use substitution variables, instead getting a default window with the name of your substitution variable allowing data entry.

  • SQLPLUS commands in SQL Developer

    We are using 11g with Sql Developer. We have some script such as healthcheck etc provided by oracle support, which has SQLPLUS commands in it.
    We are not able to run those in SQL Developer. We are getting errors.
    Are there any way, we could invoke SQLPLUS shell within SQL Developer?
    Thanks in helping.

    Hi qwe16235
    SQLPLUS command failed - not enough arguments
    line 36: SQLPLUS Command Skipped: set lines 300
    line 37: SQLPLUS Command Skipped: set pages 999
    These are formatting commands we do not do yet.
    The other command seems like an error in the middle of a PL/SQL block which we should have covered, just the start of it is not enough to know what the error is.
    An example of bad pl/sql error reporting:
    input:
    show parameter error <-------------- Dummy command so the plsql block does not begin at 1
    begin <----------------starting at line 3
    broken plsql; <------------- bad plsql at line (start)3+(from ora error)2 = 5 (should be 4 - must be one off)
    end;
    output:
    NAME TYPE VALUE
    sec_protocol_error_further_action string CONTINUE
    sec_protocol_error_trace_action string TRACE
    Error starting at line 3 in command:
    begin
    broken plsql;
    end;
    Error report:
    ORA-06550: line 2, column 8:
    PLS-00103: Encountered the symbol "PLSQL" when expecting one of the following:
    := . ( @ % ;
    The symbol ":=" was substituted for "PLSQL" to continue.
    06550. 00000 - "line %s, column %s:\n%s"
    *Cause:    Usually a PL/SQL compilation error.
    *Action:
    -Turloch
    SQLDeveloper team

  • How to execute command(program) from external file in Oracle SQL developer

    Hi,
    Does anyone know, Oracle SQL developer version 1.0.0.14.67 got any function that can execute command from an external file?
    Example, i have 100 insert SQL inside a text file,
    and i want to use Oracle SQL developer to execute it. How do i read from my text file? Thanks a lots.

    If you're new to Oracle, do yourself and us a favour: read some tutorials and manuals. What sqldev's worth, better download the latest version (1.1.2), lots of fixes and enhancements...
    Now for the big popper: to run an external file: @file
    Best of luck,
    K.

Maybe you are looking for