V2.1 - Exporting DATE columns produces invalid SQL

If you export a table with a column of type DATE, the SQL produced is invalid:
Left-click on table in tree view -> Click on "Data" tab -> Right click on data -> Export Data -> Insert -> Clipboard:
to_timestamp('01-SEP-09 17:49:21','DD-MON-RR HH.MI.SSXFF AM')
I have seen this work correctly, but I can't find the right combination now... but in this case the date format should be:
to_timestamp('01-SEP-09 17:49:21','DD-MON-RR HH24.MI.SSXFF')
Edited by: gclough on Jan 4, 2010 3:54 PM

Hi,
I encountered this problem since the EA and Vasan (one of the SQL Dev's team) gave the solution for this.
>
You can add the following in the sqldeveloper.conf to ensure that the driver doesn't report the column type of a DATE column as TIMESTAMP.
AddVMOption -Doracle.jdbc.mapDateToTimestamp=false
>
As you can see on
Re: 2.1 EA1: Problems on Date type columns
I wonder, why this isn't included on the default installation of the product, since it is absolutely wrong to use Timestamp for Date type column on the first place.
Regards,
Buntoro

Similar Messages

  • V2.1 - Exporting CLOBS produces invalid SQL

    When you export a table that has a CLOB via either of these methods, the SQL it produces is invalid (Quotes, Blank Lines, etc.) :
    1. "Tools -> Database Export"
    2. Right-click on the results page, then export as "Insert" to the clipboard
    Insert into JAVASCRIPT (ID,FUNCTION_NAME,NAME,DESCRIPTION,VALID,FUNCTION,NUMBER_OF_ARGUMENTS,JAVASCRIPT,LAST_MODIFIED_DATE) values (26,'buildParameterizedUrl','Build Parameterized URL','Build Parameterized URL',1,1,3,'function buildParameterizedUrl(url, paramArray, valueArray)
    url += '?';
    var first = true;
    for(var i in paramArray)
    if(first)
    first = false;
    else
    url += '&';
    *url += paramArray[i] + '=' + valueArray;*
    return url;
    *',to_timestamp('16-JUL-09 09.52.30.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'));*

    Hi,
    I encountered this problem since the EA and Vasan (one of the SQL Dev's team) gave the solution for this.
    >
    You can add the following in the sqldeveloper.conf to ensure that the driver doesn't report the column type of a DATE column as TIMESTAMP.
    AddVMOption -Doracle.jdbc.mapDateToTimestamp=false
    >
    As you can see on
    Re: 2.1 EA1: Problems on Date type columns
    I wonder, why this isn't included on the default installation of the product, since it is absolutely wrong to use Timestamp for Date type column on the first place.
    Regards,
    Buntoro

  • SQL DEVELOPER 1.5.3: Export Data options for using SQL to write SQL?

    I write a lot of SQL that generates SQL. In a competitor's product, I can export query results (Export > Save As > Tab Delimited) to the clipboard, paste the generated SQL into a new window, then execute the generated SQL.
    In SQL Developer, using Export Data > Text to the clipboard, it's delimiting each row with double-quotes. Is there any way to turn this behavior off to achieve what I want? Or should I be choosing a different export format?
    For now, I can do a search/replace to eliminate the double-quotes,
    Thanks.
    Dana

    Dana,
    I probably haven't done this with generating thousands of SQL lines, but I have certainly used the Ctrl-A, Ctrl-C (or Ctrl-Shift-C to get headers) to copy thousands of records of result data. Note that the Ctrl-A forces a fetch of all remaining records that have not yet been fetched, which may add to the time taken by the process - for example, running the query fetches the first 50 records and then Ctrl-A will fetch the remaining records as well as selecting them all, however long that takes. Also, there is a noticeable delay with the Ctrl-C for thousands of records - only rough counting but I was seeing a UI freeze for ~ 4 seconds when copying 10000 records from a query with around 30 columns in it (pasting the clipboard into a file produced a file just under 4MB).
    theFurryOne

  • Export data to CSV in SQL Server

    Hi,
    I am trying to write a Java JDBC program exporting data
    from the database into CSV file using SQL Server 2005 DB.
    From that query:
    String="SELECT * into OUTFILE '"+filename+'" FIELDS TERMINATED BY ',' FROM table1";
    getting: "SQLException: Incorrect syntax near 'myfilename.csv'
    Yes, I put filename in single quotes. Same problem without them, but it strips out csv file extension.
    Using JTDS driver 1.2.4 on WinXP.
    Will later need to insert that into a batch process.
    What is a reason for that error? - I saw many many posts on the net, but no good explanations so far.
    So how do I fix that ?
    Is there a better way of doing it in SQL server ?
    I am a Java developer, not a DBA or Unix Sys Admin ;-)
    Please help !
    TIA,
    Oleg.

    Here is one way to do it in Java. You can customize as you like. Do a Google on how to get a DataSource (or DriverManager) connection for SqlServer. If you do not know how to get a PrintWriter, you do something like:
    PrintWriter writer = new PrintWriter(new FileOutputStream('results.csv");This will generate a generic CSV. It is probably not ideal, but should get you started.
        public final void serialize(final DataSource ds, final String sql, final PrintWriter writer)
            throws SQLException {
            Connection conn = null;
            PreparedStatement stmt = null;
            ResultSet results = null;
            try {
                conn = ds.getConnection();
                stmt = conn.prepareStatement(sql);
                results = stmt.executeQuery();
                ResultSetMetaData meta = results.getMetaData();
                int columnCount = meta.getColumnCount();
                while (results.next()) {
                    for (int current = 0; current < columnCount; current++) {
                        Object value = results.getObject(current + 1);
                        if (current > 0) {
                            writer.print(", ");
                        writer.print("\"" + (value == null ? "" : value.toString()) + "\"");
                    writer.println();
                writer.flush();
            finally {
                if (results != null) {
                    try {
                        results.close();
                    catch (SQLException e) {
                        e.printStackTrace();
                if (stmt != null) {
                    try {
                        stmt.close();
                    catch (SQLException e) {
                        e.printStackTrace();
                if (conn != null) {
                    try {
                        conn.close();
                    catch (SQLException e) {
                        e.printStackTrace();
        }My advice is to use BCP to start. The docs for the tool are here: [http://msdn.microsoft.com/en-us/library/aa174646(SQL.80).aspx]. You can manipulate the results in Access or Excel if you need to. Since it seems you are being thrown into an emergency and getting it fast is more important than you spending months learning additional Java API's.
    - Saish

  • SQL Developer 2.1.0.63 - Export Data menu missing for SQL Server databases

    Hi
    The Export Data menu only appears for Oracle databases in this version, it does not appear for SQL server databases.
    To demonstrate:
    Press F9 to run query
    Right click on Query Result data
    For Oracle an Export Data sub menu appears
    For SQL server no Export Data sub menu appears
    This worked in previous versions.
    Is this functionality going to reappear?
    Thanks
    Dave

    Hi,
    Looks like this is exactly the same problem for third party connections as I have the exact same issue for mySQL.
    I had to apply 1.5.5 version to fix it.
    Hope we're going to have this solved !
    Thanks,
    JP

  • EA2 - BUG: Export produces invalid SQL for BINARY_DOUBLE columns

    Description:
    When a table contains a BINARY_DOUBLE column, INSERTs for that column in SQL exported with Export Wizard are invalid.
    Steps to reproduce:
    - open SQL Developer, connect to DB
    - make a table containing a BINARY_DOUBLE column, e.g.:
    CREATE TABLE "TESTTABLE" ("BINDBLCOL" BINARY_DOUBLE) ;
    - add some data (floating-point numbers) to the table
    - choose Tools -> Export Wizard (or Export DDL and Data in SQL Developer v1.2)
    - check exporting of tables and data, on "Specify Objects/Data" choose your table
    - press "Apply"
    Error:
    Generated SQL contains invalid INSERTs: floating-point numbers are enclosed in apostrophes (see below, relevant part is underlined).
    -- DDL for Table TESTTABLE
    CREATE TABLE "TESTTABLE"
    (     "BINDBLCOL" BINARY_DOUBLE
    -- DATA FOR TABLE TESTTABLE
    -- FILTER = none used
    -- INSERTING into TESTTABLE
    Insert into TESTTABLE (BINDBLCOL) values ('1.2345');
    -- END DATA FOR TABLE TESTTABLE
    The script, when run, produces following error on INSERT line:
    SQL Error: ORA-01722: invalid number
    When apostrophes are removed manually, script runs without problems.
    Remarks:
    SQL Developer: 1.5.0.52 MAIN-52.03; the same bug also on 1.2.1, build MAIN-32.13
    Oracle DB: 10 Express
    OS: Windows 2000 Professional
    Java: 1.5.0.52: 1.5.0_15; 1.2.1: 1.6.0_03

    Description:
    When a table contains a BINARY_DOUBLE column, INSERTs for that column in SQL exported with Export Wizard are invalid.
    Steps to reproduce:
    - open SQL Developer, connect to DB
    - make a table containing a BINARY_DOUBLE column, e.g.:
    CREATE TABLE "TESTTABLE" ("BINDBLCOL" BINARY_DOUBLE) ;
    - add some data (floating-point numbers) to the table
    - choose Tools -> Export Wizard (or Export DDL and Data in SQL Developer v1.2)
    - check exporting of tables and data, on "Specify Objects/Data" choose your table
    - press "Apply"
    Error:
    Generated SQL contains invalid INSERTs: floating-point numbers are enclosed in apostrophes (see below, relevant part is underlined).
    -- DDL for Table TESTTABLE
    CREATE TABLE "TESTTABLE"
    (     "BINDBLCOL" BINARY_DOUBLE
    -- DATA FOR TABLE TESTTABLE
    -- FILTER = none used
    -- INSERTING into TESTTABLE
    Insert into TESTTABLE (BINDBLCOL) values ('1.2345');
    -- END DATA FOR TABLE TESTTABLE
    The script, when run, produces following error on INSERT line:
    SQL Error: ORA-01722: invalid number
    When apostrophes are removed manually, script runs without problems.
    Remarks:
    SQL Developer: 1.5.0.52 MAIN-52.03; the same bug also on 1.2.1, build MAIN-32.13
    Oracle DB: 10 Express
    OS: Windows 2000 Professional
    Java: 1.5.0.52: 1.5.0_15; 1.2.1: 1.6.0_03

  • Date column in OBIEE-SQL Server

    Hi expert,
    I have created date (datetime)column in sql server cube. Now I wat it inmy OBIEE as date. how to do that.
    When we import,there are only three option->Double,Varchar,Unknown.

    Something wrong.... once you import table in rpd the column should have Type as DATETIME or DATE.
    If its not the case then you can change the format in rpd.
    If helps pls mark

  • Export to csv gone in SQL Server queries in 2.1

    In 1.5 I could save the output from SQL Server queries to a CSV or XLS file.
    The entire option is now gone.
    This is very important to our organization

    Based on Re: How export result in sybase in SQL Developer 2.1 ? and Re: SQL Developer 2.1.0.63 - Export Data menu missing for SQL Server databases it looks like this was intentionally removed (for some reason not given) and will not be back in the short term (or longer, depending on what Barry meant by "this release" back in the time of 2.1's release candidate version). Short of using something like "select all in the results tab, copy, paste into Excel, save as CSV" (relatively painful and subject to Excel interpreting text as numbers or dates instead of text), the simplest would probably be to revert to 1.5.
    theFurryOne

  • Exporting Data to external database

    Hi All,
    As background our SAP systems use Oracle on Solaris.
    I have written programs that export data to an external oracle database also running on solaris by embedding native SQL in the ABAP program.
    There is now a requirement to export data to a MS SQL Server database running on Windows.
    We are on BW v3.5. I know this was not possible previously can anyone confirm whether the method above will still not work for a SAP system running on Solaris exporting to MS SQL Server on Windows? i.e. Native SQL in ABAP program.
    Many Thanks
    David

    I don't know very well it, but it's a tool to link SAP to external database.
    No u can create a link in the table DBCON and then insert native SQL code in ABAP prog. using EXEC SQL statament.
    I used it only once, I hope it can be usefull for u.
    Try to see this note: 178949<a href="https://websmp230.sap-ag.de/sap(bD1pdCZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=0000178949&nlang=E">https://websmp230.sap-ag.de/sap(bD1pdCZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=0000178949&nlang=E</a>
    Anyway this the text:
    Symptom
    DATABASE MULTICONNECT WITH EXEC SQL
    This note describes the possibility of accessing data with EXEC SQL which is not on the R/3 database server but on another MSSQL system.
    Other terms
    CONNECT DBCON OLEDB dblib
    Reason and Prerequisites
    It's desired to make a connection to a SQL Server database running on a server different from the R/3 server.
    Prerequisite: At least one Windows application server must be available on the R/3 system and the DBSL dynamic library (DLL) dbmssslib.dll must be installed on this server. This dll can be downloaded from the SAP Service Marketplace.
    Solution
    Basics of the EXEC SQL MultiConnect
                OPEN SQL database accesses always refer to the R/3 database for the particular R/3 system's <SID> (three letter uppercase database name). EXEC SQL accesses normally also refer to the R/3 database. To access data which is on the R/3 database server in a database other than the <SID> database, it is sufficient to enter the table name qualified by the database name in EXEC SQL.
    Example:
    EXEC SQL.
      SELECT MYFIELD FROM MYDB..MYTABLE
    ENDEXEC.
    Furthermore, you have the option in R/3 to access data with EXEC SQL which are on other SQL Server systems.
    Creating a DBCON entry for a remote connection
                Every link which should be addressed via the Multiconnect must be described by a record in table DBCON. This entry can be created by means of the transaction sm30. For SQL Server create an entry as follows:
    CON_NAME: <my_conn_name>
    DBMS: MSS
    USER_NAME: <db_user>
    PASSWORD:  <password>
    CON_ENV: MSSQL_SERVER=<server_name> MSSQL_DBNAME=<db_name>
                db_user could be sapr3 for example if the server is running R/3.  The password field may be blocked from view by asterisks in sm30. USER_NAME can be left blank in order to use integrated security (4.6d kernel and later).  In that case make sure that the OS User running R/3 has the required privilege on the remote server.  A dummy password must be entered in sm30, it will not be used when the user name is blank.
    Specifying the server name
                The server name is simply the name of the SQL Server or named instance i.e. the hostname (for a default instance), or <host>\<instname>
    Starting with release 6.40 however there are some special considerations that should be taken into account.  When running with kernel release 6.40 or later, the R/3 system will prepend a protocol specifier to the server name.  Example:
       1. For a server running on the same server:
                 np:<servername>
       2. For a remote server:
                tcp:<servername>
    This forces the connection to be made with a named pipes and tcp/ipprotocols respectively.
    When specifying the server name you can override this by setting your own protocol (tcp: or np:), or you can make R/3 avoid setting any prefix by using simply :<servername> - a colon in front of the server name.
    How to use the Multiconnect
               Here is an example for how to connect to another server with CON_NAME=BSK.  The example assumes BSK is running R/3:
               EXEC SQL.
      CONNECT TO 'BSK'
    ENDEXEC.
    EXEC SQL.
      SET CONNECTION 'BSK'
    ENDEXEC.
    EXEC SQL.
      SELECT db_name() INTO :DBN FROM SVERS
    ENDEXEC.
    WRITE: / 'current database name', DBN.
    EXEC SQL.
      SET CONNECTION DEFAULT
    ENDEXEC.
    EXEC SQL.
      SELECT db_name() INTO :DBN FROM SVERS
    ENDEXEC.
    WRITE: / 'current database name', DBN.
    Tools for creating DBCON entries
               In SAP basis release 6. 40 new tools were introduced to make it easier to create DBCON entries for use in remote monitoring.  These tools are accessible through st04_mss -> "Change connection data" button -> Go To -> "Maintain DBCON" for example.
    The "Change connection data" button is the small pencil icon on the right hand side of the main st04_mss screen.
               There is an on-line guide for creating DBCON entries this way.   It is available on:
               http://help.sap.com
       Documentation -> SAP NetWeaver -> SAP NetWeaver '04
                And then expand the tree on the left hand side using SAP NetWeaver -> Application Platform -> Databases -> SAP/MS SQL Server 2000 DBA in CCMS.
               Finally go to Database Management Tools -> Monitoring Remote SQL Server Databases -> Setting Up the Remote Connection -> Creating a DBCON Entry.
    Max

  • How to export data with column headers in sql server 2008 with bcp command?

    Hi all,
    I want know "how to export data with column headers in sql server 2008 with bcp command", I know how to import data with import and export wizard. when i
    am trying to import data with bcp command data has been copied but column names are not came.
    I am using the below query:-
    EXEC master..xp_cmdshell
    'BCP "SELECT  * FROM   [tempdb].[dbo].[VBAS_ErrorLog] " QUERYOUT "D:\Temp\SQLServer.log" -c -t , -T -S SERVER-A'
    Thanks,
    SAAD.

    Hi All,
    I have done as per your suggestion but here i have face the below problem, in print statment it give correct query, in EXEC ( EXEC master..xp_cmdshell @BCPCMD) it was displayed error message like below
    DECLARE @BCPCMD
    nvarchar(4000)
    DECLARE @BCPCMD1
    nvarchar(4000)
    DECLARE @BCPCMD2
    nvarchar(4000)
    DECLARE @SQLEXPRESS
    varchar(50)
    DECLARE @filepath
    nvarchar(150),@SQLServer
    varchar(50)
    SET @filepath
    = N'"D:\Temp\LDH_SQLErrorlog_'+CAST(YEAR(GETDATE())
    as varchar(4))
    +RIGHT('00'+CAST(MONTH(GETDATE())
    as varchar(2)),2)
    +RIGHT('00'+CAST(DAY(GETDATE())
    as varchar(2)),2)+'.log" '
    Set @SQLServer
    =(SELECT
    @@SERVERNAME)
    SELECT @BCPCMD1
    = '''BCP "SELECT 
    * FROM   [tempdb].[dbo].[wErrorLog] " QUERYOUT '
    SELECT @BCPCMD2
    = '-c -t , -T -S '
    + @SQLServer + 
    SET @BCPCMD
    = @BCPCMD1+ @filepath 
    + @BCPCMD2
    Print @BCPCMD
    -- Print out below
    'BCP "SELECT 
    * FROM   [tempdb].[dbo].[wErrorLog] " QUERYOUT "D:\Temp\LDH_SQLErrorlog_20130313.log" -c -t , -T -S servername'
    EXEC
    master..xp_cmdshell
    @BCPCMD
      ''BCP' is not recognized as an internal or external command,
    operable program or batch file.
    NULL
    if i copy the print ourt put like below and excecute the CMD it was working fine, could you please suggest me what is the problem in above query.
    EXEC
    master..xp_cmdshell
    'BCP "SELECT  * FROM  
    [tempdb].[dbo].[wErrorLog] " QUERYOUT "D:\Temp\LDH_SQLErrorlog_20130313.log" -c -t , -T -S servername '
    Thanks, SAAD.

  • SQL Data Sync - column type invalid for use as a key column

    Hello,
    our sync group is failing to do the sync. Here's a tracingID:
    For more information, provide tracing ID ‘e3e568b5-140a-4ae5-a4c8-c178c6bf805d’ to customer support.
    I must say, that the column in DB is not a PK or INDEX-ed, it was initially VARCHAR(MAX), after some reading I changed it to VARCHAR(200) and later to TEXT, but the result of syncing is still the same.
    Thank you,
    Bojan

    Hi Bojan,
    The error “column type invalid for use as a key column” could be due to the existence of unsupported data types or column properties when implementing the synchronization. I recommend you check your database according to this article:
    SQL Database Data Types supported by SQL Data Sync.
    Besides, before you design and implement a data synchronization plan, please check the following articles about system requirements for SQL Data Sync and so on.
    System Requirements for SQL Data Sync
    https://msdn.microsoft.com/en-us/library/azure/jj127278.aspx
    Known SQL Data Sync Limits
    https://msdn.microsoft.com/en-us/library/azure/jj590380.aspx
    SQL Data Sync Best Practices
    https://msdn.microsoft.com/en-us/library/azure/hh667328.aspx
    Thanks,
    Lydia Zhang
    Lydia Zhang
    TechNet Community Support

  • Error while exporting data from sql server to excel

    Hi,
    I am trying to export data from sql server to excel.
    The query that I used is s follows
    INSERT INTO OPENROWSET( 'Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=C:\Folder1\abc.xls','select * from [Sheet1$A1:IV65000]')
    select 
    column1,column2.... from Table1
    I get the following error message while doing so..
    String or binary data would be truncated.
    The statement has been terminated.
    One of the column's holds data more than 225 characters.
    What is the way to correct this, i want the whole data of the colum in the excel sheet.

    I haven't had great luck with the INSERT INTO OPENROWSET method.  Can you try one of the many samples from one of these 3 links?
    http://www.excel-sql-server.com/excel-sql-server-import-export-using-vba.htm#Excel%20Data%20Export%20to%20SQL%20Server%20Test%20Code 
    http://www.mssqltips.com/sqlservertip/1540/insert-update-or-delete-data-in-sql-server-from-excel/
    https://www.simple-talk.com/sql/database-administration/getting-data-between-excel-and-sql-server-using-odbc--/
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

  • SQL Developer 2.1.0.63.73 exports DATE as TIMESTAMP

    I believe this is a bug. When I export a table to an XLS file, the values contained in DATE columns are saved as if they were TIMESTAMP:
    eg. 31-DEC-09 12:00:00 AM would export as 31-DEC-09 12.00.00.000000000 AM
    Not really a huge deal until you try to import it back in, in which case you can't import a TIMESTAMP into a DATE column. First, you'll get an error about the AM/A.M. or PM/P.M. missing. You can't explicitly specify the date format during the import either as Oracle rejects it since it's not supported. The proper way is to cast it back to a date, but you can't do that through the import function.
    Regardless, I think the export function should export DATEs according to the Date Format NLS settings but it is not.
    If it makes any difference, I'm using the 64-bit Windows version of SQL Developer on Windows 7 64-bit with the Oracle 64-bit client.

    Hi,
    Not sure if this is something related to my previous problem.
    My SQL Dev gives the correct date format on exporting to Excel, but fails on export INSERT statement
    Vasan, one of the sql dev's team member, gave this workaround which solved my problem
    >
    You can add the following in the sqldeveloper.conf to ensure that the driver doesn't report the column type of a DATE column as TIMESTAMP.
    AddVMOption -Doracle.jdbc.mapDateToTimestamp=false
    >
    as suggested in this thread
    Re: 2.1 EA1: Problems on Date type columns
    Hope this help,
    Buntoro

  • Statement terminator problems when exporting data with SQL Developer 3.2

    I've ran across what appears to be a bug with SQL Developer 3.2.20.09. If someone can let me know if this is indeed a bug, or just something I need to configure differently, please let me know.
    The problem is related to exporting a database as a SQL script, and terminator characters at the end of "create" statements, especially when columns have comments, and problems that occur when using SQLPlus to run the export script to create the tables. With the old SQL Developer 1.5.4, with the "Terminator" and "Pretty Print" options checked, statements like the following are generated:
    -- DDL for Type NUM_ARRAY
    CREATE OR REPLACE TYPE "NUM_ARRAY"
    IS TABLE OF NUMBER(20)
    -- DDL for Sequence MYTABLE_SEQ
    CREATE SEQUENCE "MYTABLE_SEQ" MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE ;
    -- DDL for Table MYTABLE
    CREATE TABLE "MYTABLE"
    (     "MYTABLE_ID" NUMBER,
         "COL2" NUMBER,
         "COL3" NUMBER
    -- DDL for Table ANOTHERTABLE
    CREATE TABLE "ANOTHERTABLE"
    (     "ANOTHERTABLE_ID" NUMBER,
         "COL2" VARCHAR2(1024),
         "COL3" VARCHAR2(1024)
    COMMENT ON COLUMN "ANOTHERTABLE"."ANOTHERTABLE_ID" IS 'This is a comment.';
    When I then run the script using SQLPlus, everything works fine. However, with SQL Developer 3.2.20.09, with the same options enabled, the same statements are generated like this:
    -- DDL for Type NUM_ARRAY
    CREATE OR REPLACE TYPE "NUM_ARRAY"
    IS TABLE OF NUMBER(20)
    -- DDL for Sequence MYTABLE_SEQ
    CREATE SEQUENCE "MYTABLE_SEQ" MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE ;
    -- DDL for Table MYTABLE
    CREATE TABLE "MYTABLE"
    (     "MYTABLE_ID" NUMBER,
         "COL2" NUMBER,
         "COL3" NUMBER
    -- DDL for Table ANOTHERTABLE
    CREATE TABLE "ANOTHERTABLE"
    (     "ANOTHERTABLE_ID" NUMBER,
         "COL2" VARCHAR2(1024),
         "COL3" VARCHAR2(1024)
    COMMENT ON COLUMN "ANOTHERTABLE"."ANOTHERTABLE_ID" IS 'This is a comment.';
    Notice all of the extra slashes in there. If a slash is not used as a statement terminator, SQLPlus treats slashes as a command to repeat the last SQL statement, which causes many errors about tables or sequences already existing. So, I tried removing the "Terminator" flag from the export options. This lead to statements that looked a bit more promising:
    -- DDL for Type NUM_ARRAY
    CREATE OR REPLACE TYPE "NUM_ARRAY"
    IS TABLE OF NUMBER(20)
    -- DDL for Sequence MYTABLE_SEQ
    CREATE SEQUENCE "MYTABLE_SEQ" MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE
    -- DDL for Table MYTABLE
    CREATE TABLE "MYTABLE"
    (     "MYTABLE_ID" NUMBER,
         "COL2" NUMBER,
         "COL3" NUMBER
    -- DDL for Table ANOTHERTABLE
    CREATE TABLE "ANOTHERTABLE"
    (     "ANOTHERTABLE_ID" NUMBER,
         "COL2" VARCHAR2(1024),
         "COL3" VARCHAR2(1024)
    COMMENT ON COLUMN "ANOTHERTABLE"."ANOTHERTABLE_ID" IS 'This is a comment.'
    The big problem, though, is in the statement for the table with a comment. Notice that there are two statements, but there is not a semicolon after either of them. This unfortunately causes the "COMMENT" statement to be appended to the "CREATE TABLE" statement before being executed, which causes the table to not be created (which causes even more errors later on when the script attempts to populate the table with data).
    So, it would appear that this is a bug, but I'm not sure. Is there a way I can configure the export options to make SQL Developer export these statements like it used to in older versions?
    Thanks,
    -Bill

    >
    So, it would appear that this is a bug, but I'm not sure.
    >
    That would be a bug. Thanks for reporting it and providing the detailed example.
    >
    Is there a way I can configure the export options to make SQL Developer export these statements like it used to in older versions?
    >
    No.
    Leave the thread open. One of the developers for sql developer should be monitoring the forum and can provide more information.

  • Issue to export data from sql to excel

    I have MS SQL 2008 Developer version and visual studio 2008. I'm using SSIS Import and Export Wizard on the VS2008 to create a simple package to export data from a table using a sql query to excel file (.xlsx), but I got the following
    error messages:
    [Destination - Query [37]] Error: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80040E21.
    [Destination - Query [37]] Error: Cannot create an OLE DB accessor. Verify that the column metadata is valid.
    [SSIS.Pipeline] Error: component "Destination - Query" (37) failed the pre-execute phase and returned error code 0xC0202025.
    The SQL query is
    SELECT [BusinessEntityID]
          ,[PersonType]
          ,[NameStyle]
          ,[Title]
          ,[FirstName]
          ,[MiddleName]
          ,[LastName]
      FROM [AdventureWorks2008].[Person].[Person]
    Any help will be appreciated. Thanks.
    A Fan of SSIS, SSRS and SSAS

    Or another way is to save the package created by Export Import wizard, open it in BIDS and add a Derived column task before the Excel destination to do explicit casting of the columns to your required unicode datatypes.
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

Maybe you are looking for

  • Every time i try to update my iPhone 4 to iSO5 it keeps saying my network has timed out! i dont know how to fix it! help please!

    im connected to my network 100%! my brother updated his iphone with no problem with a pc and he has the same network. i dont really know how to fix this .

  • Problem with Project 2007 gantt chart in Acrobat X

    Good morning, We are experiencing an issue with certain, rather large gantt charts in Project 2007 when converting them to PDF using Acrobat X. The issue is that the last portion of the chart is broken when converted to PDF. The chart will print prop

  • Can't import layered photoshop files

    In Motion's File Browser all I get is a big white image with an error message saying "This layered photoshop file wasn't saved with a composite image". I have maximum compatibility checked in photoshop (for saving files) which is the ONLY thing in PS

  • Fcp won't let me save

    When trying to save it says 'operation not allowed'. Does anyone know why this may be? I have tried saving locally, on a server and eternal harddrive. Any advice would be great, hopefully I get it before the programme crashes

  • Database authentication with 9iAS

    Hi, I was wondering if anyone nows when it will be possible to use database authentication with 9iAS. I don't mean just removing the password from the DAD configuration and authentication that way. I want to be able to have basic Oracle authenticatio