[1.1.1.25.14] BUG: Export to insert statement produces bad sql

I haven't seen anyone from oracle on the thread below and wanted to make sure it gets seen so that the bug can be logged.
See this thread:
Export to INSERT error

It has to do with data types. I think that the data appears in the correct order, but the quotes don't.
For example:
Using HR.COUNTRIES as an example:
Reorder REGION_ID to the first position and export to insert via file.
The file looks like this. Note the lack of quotes around COUNTRY_ID:
REM INSERTING into COUNTRIES
Insert into COUNTRIES ("REGION_ID","COUNTRY_ID","COUNTRY_NAME") values ('2',AR,'Argentina');
Insert into COUNTRIES ("REGION_ID","COUNTRY_ID","COUNTRY_NAME") values ('3',AU,'Australia');
Insert into COUNTRIES ("REGION_ID","COUNTRY_ID","COUNTRY_NAME") values ('1',BE,'Belgium');
Insert into COUNTRIES ("REGION_ID","COUNTRY_ID","COUNTRY_NAME") values ('2',BR,'Brazil');
Insert into COUNTRIES ("REGION_ID","COUNTRY_ID","COUNTRY_NAME") values ('2',CA,'Canada');
Insert into COUNTRIES ("REGION_ID","COUNTRY_ID","COUNTRY_NAME") values ('1',CH,'Switzerland');
Insert into COUNTRIES ("REGION_ID","COUNTRY_ID","COUNTRY_NAME") values ('3',CN,'China');
Insert into COUNTRIES ("REGION_ID","COUNTRY_ID","COUNTRY_NAME") values ('1',DE,'Germany');
Insert into COUNTRIES ("REGION_ID","COUNTRY_ID","COUNTRY_NAME") values ('1',DK,'Denmark');
Insert into COUNTRIES ("REGION_ID","COUNTRY_ID","COUNTRY_NAME") values ('4',EG,'Egypt');
Insert into COUNTRIES ("REGION_ID","COUNTRY_ID","COUNTRY_NAME") values ('1',FR,'France');
Insert into COUNTRIES ("REGION_ID","COUNTRY_ID","COUNTRY_NAME") values ('3',HK,'HongKong');
Insert into COUNTRIES ("REGION_ID","COUNTRY_ID","COUNTRY_NAME") values ('4',IL,'Israel');
Insert into COUNTRIES ("REGION_ID","COUNTRY_ID","COUNTRY_NAME") values ('3',IN,'India');
Insert into COUNTRIES ("REGION_ID","COUNTRY_ID","COUNTRY_NAME") values ('1',IT,'Italy');
Insert into COUNTRIES ("REGION_ID","COUNTRY_ID","COUNTRY_NAME") values ('3',JP,'Japan');
Insert into COUNTRIES ("REGION_ID","COUNTRY_ID","COUNTRY_NAME") values ('4',KW,'Kuwait');
Insert into COUNTRIES ("REGION_ID","COUNTRY_ID","COUNTRY_NAME") values ('2',MX,'Mexico');
Insert into COUNTRIES ("REGION_ID","COUNTRY_ID","COUNTRY_NAME") values ('4',NG,'Nigeria');
Insert into COUNTRIES ("REGION_ID","COUNTRY_ID","COUNTRY_NAME") values ('1',NL,'Netherlands');
Insert into COUNTRIES ("REGION_ID","COUNTRY_ID","COUNTRY_NAME") values ('3',SG,'Singapore');
Insert into COUNTRIES ("REGION_ID","COUNTRY_ID","COUNTRY_NAME") values ('1',UK,'United Kingdom');
Insert into COUNTRIES ("REGION_ID","COUNTRY_ID","COUNTRY_NAME") values ('2',US,'United States of America');
Insert into COUNTRIES ("REGION_ID","COUNTRY_ID","COUNTRY_NAME") values ('4',ZM,'Zambia');
Insert into COUNTRIES ("REGION_ID","COUNTRY_ID","COUNTRY_NAME") values ('4',ZW,'Zimbabwe');
Thanks,
Eric

Similar Messages

  • Export to INSERT STATEMENT Possible Bug

    h2. Synopsis
    Currently, if your table has nested tables using Types, the export to INSERT STATEMENT does correctly create the insert statement. In the sample below, the PURGE_WHERE_CLAUSE is a nested table (TYPE and TABLE of TYPE)
    h2. Examples
    h4. Below is an example of the incorrectly created insert statement made by SQL Developer.
    INSERT
    INTO PRG_DTLS
    PRG_NAME,
    TABLE_ID,
    FILE_ID,
    PRG_ORDER_SEQ_NO,
    PRG_ACTION_ID,
    OPERATING_SYSTEMS_ID,
    PRG_WHERE_CLAUSE,
    CREATED_BY,
    CREATED_DATE,
    LAST_UPDATED_BY,
    LAST_UPDATED_DATE
    VALUES
    'GUITEST01',
    26,
    NULL,
    1,4,
    NULL,
    *'STGMGR.PRG_CRITERIA(STGMGR.PRG_CRITERIA(PRCS_ID,=,1,null,null,null))',*
    'XXXXXXX',
    to_date('21-MAY-09','DD-MON-RR'),
    'XXXXXXX',
    to_date('21-MAY-09','DD-MON-RR')
    h4. Below is a sample of how it should correctly be made
    INSERT
    INTO STGMGR.PRG_DTLS
    PRG_NAME,
    TABLE_ID,
    PRG_ORDER_SEQ_NO,
    PRG_ACTION_ID,
    PRG_WHERE_CLAUSE,
    CREATED_BY,
    CREATED_DATE,
    LAST_UPDATED_BY,
    LAST_UPDATED_DATE
    VALUES
    'GUITEST01',
    26,
    1,
    4,
    *"STGMGR"."PRG_CRITERIA_NT"( "STGMGR".PRG_CRITERIA('PRCS_ID','=','1',NULL,NULL,NULL)),*
    'XXXXXXXX',
    TO_DATE('05/21/2009 15:45:18', 'MM/DD/YYYY HH24:MI:SS'),
    'XXXXXXX',
    TO_DATE('05/21/2009 15:45:18', 'MM/DD/YYYY HH24:MI:SS')
    COMMIT;
    h2. Is there a workaround or fix?
    I've attempted to see if I can find a fix for this in some type of settings in the preference but I have not yet found anything. Has anyone found a fix for this issue?

    Hi Barry,
    It is a Type and Table of types stored as a nested table in a regular table.
    Its basically a tool we created to store the WHERE clauses for an automated tool that will delete old data that we no longer need from our database.
    So, it dynamically stores and creates the DELETE statements.
    Hope this answers your question Barry.
    Thanks.

  • Problem with single quote when exporting insert statement

    Hi
    I'm using Oracle SQL Developer 2.1.1.64 on Ubuntu 10.04. I got some records which has single quote in it.
    For example,
    Let says Table '*TABLE_A*' has varchar2 column called '*COL_A*'.
    And there is only one record in the table and the value is:
    his friend's dog name is dog.
    When I export that table data to insert statement, i got this:
    Insert into TABLE_A (COL_A) VALUES ('his friend's dog name is dog.');
    As you can see friend's is wrong, it should be friend''s instead. (note the double single quotes).
    Anyone knows how to fix this please?

    Yes - that's a bug. But probably not what you're expecting.
    Mind you really can't use "normal" SQL on LOBs, because they're just too big to fit in the statements.
    You should export and import them through e.g. the DBMS_LOB package.
    I do remember some request on the SQL Developer Exchange to automate this, so go vote there to add weight for future implementation.
    So the bug is that the column's fields should all yield NULL inside the INSERTs.
    Regards,
    K.

  • 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.

  • Bug in oracle portal: problem in pl/sql item type

    I created a pl/sql item type... based on a stored proc... whenever I make a change to the store proc I have to readd the item based on this item type since the result on the item type is not updated is this some bug in oracle portal

    I created a pl/sql item type... based on a stored proc... whenever I make a change to the store proc I have to readd the item based on this item type since the result on the item type is not updated is this some bug in oracle portal

  • Export/Import subpartition stats

    I hope someone can give me a workaround for this, because it's causing our reports to take longer than they should!
    Background:
    We have some sub-partitioned tables on a 10.2.0.3 database, partitioned daily on the date column, with the subpartitions based on a list of values.
    Overnight, various reports are run. Each report loads its data into the table, and then produces a file based on the data that's been loaded for that report. It is not practical (IMO) to analyze the tables after each report has loaded its data, due to other reports loading their data at the same time.
    As the amount of data loaded into the tables each night does not vary significantly, we export the stats from a previous partition and import them into the new partition as part of the partition housekeeping job (stats imported from old partition, old partition gets dropped, new partition created with same name as the old one, and stats imported). This is done using dbms_sql.export_table_stats and dbms_sql.import_table_stats.
    However, one report which currently loads 43million rows is taking 4.5 hours to run. The size of the load file increases daily, but looking at the history of the report, each relatively small increase causes the report to run a disproportional amount longer (ie. an increase of a similar amount of rows on one night can add twice as much time onto the length of the report than the increase the previous night did).
    We've just implemented some changes to improve the buffer sizes, etc, on the database, in a bid to reduce some of the waits, but this has not improved matters much - the report now runs in 4 hours.
    We know this report can run faster, because in testing, we saw the report run in 60 minutes! Subsequent investigation shows that this was after the partitions had been analyzed, whereas the slow report ran prior to the partitions being analyzed, despite the stats being there for the partition.
    I have now tested the export/import stats process and found that they do not import the stats for the subpartitions. This looks like it is a large part of why the report takes longer before the relevant partitions/subpartitions have been analyzed than it does afterwards.
    Does anyone know of anyway that I can export/import the stats at a subpartition level? (I tried putting a subpartition name in the partition parameter, but I just got an error about it being an unknown partition name.)
    Any help, ideas or workarounds on this will be gratefully received!

    *** Duplicate Post - Please Ignore ***

  • Any way to export a financial statement to another SAP system?!?

    Hi (and besides a Happy New Year to you all),
    does any of you know a way to easily export a financial statement / P&L structure and to import it to another SAP system (like the way you can export and import Profit Center reports)?!? Both systems do have nearly the same accounts.
    Any help will be appreciated (and awarded)
    Thanks in advance,
    Christian Kaes

    First, no, you cannot thread between files, so you would need to move pages from one file into the other.
    Second, you can certainly export the book to PDF. There are two "flavors" of PDF, interactive or print, but either one can be used to make a PDF from the entire Book. Choose Export Book as PDF from the Book Panel flyout menu, choose your flavor as appropriate, then choose a location and finally the options.

  • Is it possible to copy or export metadata from Folio Producer?

    Hi,
    Is it possible to copy or export metadata from one issue in Folio Producer and import/apply it to a different issue in Folio Producer? Or create a master metadata template that every issue build could use? It would save a lot of time and typing not having to re-enter the same information every month when releasing the next issue for departments, bylines, etc.
    Thanks!

    Bob,
    Do you know when exporting metadata from Folio Producer will be available, and will it export directly to another rendition, or would it export to a sidecar.xml file?
    The workflow my team prefers is to build our 1024x768 folio first, add metadata via Properties in the Folio Builder as we add articles, share the folio with editors and advertising sales, make edits and updates, then when all content is approved, create the 2048x1536 rendition folio using multiple importing of articles.
    Having the ability to export from an existing folio in Folio Producer would save tons of tedious copying/pasting to get a sidecar.xml.
    Hopefully when this becomes available you'll have a big announcement. (Please?)
    Thanks in advance.
    Mark

  • Script request for  exporting, importing, inserting entry to Oracle 9i LDAP

    Do anyone has the scripts for exporting, importing, inserting entry to Oracle 9i LDAP server? Thanks for help.

    you can use ldapsearch utility to generate ldif files. Perform a search on the node you want to export and specify the output to be in LDIF format ( -L - this is a ldapsearch option). Once you have the ldif file, you can import it to any LDAPv3 complaint server such as OID. for OID, use ldapadd/ldapmodify utility to import the data.
    These utilities are present under IAS_HOME/bin or ORACLE_HOME/bin.

  • Export failed in Folio Producer

    I'm having repeated export failure in Folio PRoducer on a folio that I've already exported 4 times with no problems. I can't figure out what is different since there was a minor fix, then I updated, and now it won't export. the message is just "An error has occured while exporting the folio."
    any ideas for what I might do to get past this??

    Hi Michelle,
    I've exported this folio and built an iPad single viewer app just yesterday.
    The folio is changhed, but we made only some minor changes like text correction.
    There is no problem to view this new folio on the Adobe viewer
    The download of the zip file doesn't start, but the error message is generic.
    written on a iPhone
    Il giorno 05/gen/2012, alle ore 17:27, "[email protected]" <[email protected]> ha scritto:
    Re: export failed in Folio Producer
    created by [email protected] in Digital Publishing Suite - View the full discussion
    Adobe engineering has looked into this and found that the server queues appear to be functioning properly at this point.  I’ve also tried export from test accounts and seen it succeed.  Thus we are not encountering the same problem as we were a few days ago.
    Can you provide specifics of the error or failure you are receiving?
    Have you successfully exported this folio previously?  Have you made changes since?
    Are you able to preview the folio without warning messages?
    Thanks,
    Michelle
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4120151#4120151
    To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4120151#4120151. In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in Digital Publishing Suite by email or at Adobe Forums
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • Export to "insert" spatial data

    I'm using sqldeveloper-1.1.3.with an 11g R1 database. I'm trying to get the insert statements (including the SDO_GEOMETRY) from a table which I loaded from Shapefile.
    I am getting inert statements without any spatial data like below:
    Insert into TU (TRID,GEOM) values (100,'MDSYS.SDO_GEOMETRY');
    I am using this method: Right-click on the table in the "connections explorer tree", select Export Data, then insert...
    Is there any other way to export spatial data to insert sql.

    Thnx Irian
    I used the same with sql Developer 2.1. It worked fine

  • Export to Insert (clipboard) - Bad Data / Unable to use

    I have been using SQL Developer 1.1.0 at work and recently was updated to the latest (2.1.0.63.73). The problem I have is with the export, to an insert, giving me the wrong formatting and an unusable statement.
    My steps for exporting... Right click result(s) --> Export Data --> Insert --> choose clipboard --> change table --> Apply
    Here is an example of what it would look like with version 1.1.0 (the correct formatting):
    REM INSERTING into data_tracker
    Insert into data_tracker ("DATA_ID","DATA_FILE","DATE_OF_DATA","DATE_LOADED","DATE_REMOVED","DATE_RECEIVED") values ('DATAFILE','DATAFILE.XLS',to_date('31-JAN-10','DD-MON-RR'),null,null,to_date('12-FEB-10','DD-MON-RR'));
    But when i run the same exact same steps in 2.1.0.63.73 I get the following:
    REM INSERTING into data_tracker
    Insert into "data_tracker" (DATA_ID,DATA_FILE,DATE_OF_DATA,DATE_LOADED,DATE_REMOVED,DATE_RECEIVED) values ('XXX','DATAFILE.XLS',to_timestamp('31-JAN-10','DD-MON-RR HH.MI.SSXFF AM'),null,null,to_timestamp('12-FEB-10','DD-MON-RR HH.MI.SSXFF AM'));
    I need to get the formatting back to setting quotes around the table columns, i need the table to no longer be in quotes, and I need to get the time stamp to correctly be exported (DD-MON-RR).
    Any assistance would be greatly appreciated. I have tried to go through the preferences, however there are so many new options in 2.1 that aren't in 1.1, I am unable to sufficiently locate the exact settings that I may need to alter. I will post any settings that may help in correcting my situation.
    Thanks,
    Nick

    That has been happening since the 1.5 versions. See 1.5/EA3/EA2/EA1: Export Wizard can't export dates? on how to fiddle with the Preferences - Database - NLS settings to get it going.
    Hope that helps,
    K.

  • 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

  • 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

  • Exporting As QuickTime Movie Produced Horizontal Lines Near Movement

    I select Export > QuickTime Movie to produce a full quality full resolution video. Then I open the movie in QuickTime and I see horizontal lines wherever there is movement in the video. Why is this happening. And if I want to export a full quality full resolution video from my 29.97fps 1920x1080 film do I chose Export > QuickTime?

    When played on a TV, you shouldn't notice the interlacing. CRT TVs are made for displaying interlaced video and progressive scan TVs usually deinterlace the signal prior to display.
    If it's for computer viewing only, deinterlace the video when exporting.
    -DH

Maybe you are looking for