Export sql insert generates to_date('1987-04-19','DD-MON-RR')

export sql insert generates buggy dates :
Scott --> Tables --> EMP --> export --> sql inserts
Columns --> ALL
Insert into "EMP" ("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO") values (7788,'SCOTT','ANALYST',7566,to_date('1987-04-19','DD-MON-RR'),3000,null,20);
the to_date is invalid.
this bug happens only when selecting ALL columns
cheers
Laurent

Hi Sue,
I have version 1.0.0.15.57 Linux x86 (downloaded last week).
Is there a way to produce trace files or additional info so that we can debug this one?
$ env
PATH=/bin:/usr/bin
LANG=en_US.UTF-8
HOME=/home/lsc
DISPLAY=:0.0
_=/usr/bin/env
$ cat /etc/SuSE-release
SUSE Linux Enterprise Server 10 (i586)
VERSION = 10
$ /home/lsc/sqldeveloper/sqldeveloper
Oracle SQL Developer 1.0
Copyright (c) 2005 Oracle Corporation.  All Rights Reserved.
Working directory is /home/lsc/sqldeveloper/jdev/bin
Assert: Initializing.. [email protected]
Assert: Unknown Node:8: USER
Assert: Unknown Node:8: SHARED QUERIES
Assert: Unknown Node:8: TABLE EDITORS
Assert: Unknown Node:8: VIEWS
Assert: Unknown Node:8: MVIEWS
Assert: Unknown Node:8: SYNONYM
Assert: Unknown Node:8: SEQ
Assert: Unknown Node:8: Recycle Bin
Assert: Unknown Node:8: DB Link
Assert: Unknown Node:8: MVIEW LOG
Assert: Unknown Node:8: PLSQL
Assert: Unknown Node:8: TRigger
Assert: Unknown Node:8: INDEX
Assert: SQLView initedAssert: Folder:Unsupported node in report.xml:#text
Assert: Folder:Unsupported node in report.xml:#text
Assert: Folder:Unsupported node in report.xml:#text
Assert: Folder:Unsupported node in report.xml:#text
Assert: Folder:Unsupported node in report.xml:#text
Assert: Folder:Unsupported node in report.xml:#text
Assert: Folder:Unsupported node in report.xml:#text
Assert: Folder:Unsupported node in report.xml:#textexpand "connections "
expand "LSC02"
expand "Tables"
select "EMP"
right-click EMP
chose EXPORT--SQL INSERT
Format=INSERT Output=File TABLE=EMP File=/home/lsc/EMP.sql Columns=ALL
Click apply
$ cat EMP.sql
-- INSERTING into EMP
Insert into "EMP" ("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO") values (7369,'SMITH','CLERK',7902,to_date('1980-12-17','DD-MON-RR'),800,null,20);
Insert into "EMP" ("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO") values (7499,'ALLEN','SALESMAN',7698,to_date('1981-02-20','DD-MON-RR'),1600,300,30);
Insert into "EMP" ("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO") values (7521,'WARD','SALESMAN',7698,to_date('1981-02-22','DD-MON-RR'),1250,500,30);
Insert into "EMP" ("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO") values (7566,'JONES','MANAGER',7839,to_date('1981-04-02','DD-MON-RR'),2975,null,20);
Insert into "EMP" ("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO") values (7654,'MARTIN','SALESMAN',7698,to_date('1981-09-28','DD-MON-RR'),1250,1400,30);
Insert into "EMP" ("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO") values (7698,'BLAKE','MANAGER',7839,to_date('1981-05-01','DD-MON-RR'),2850,null,30);
Insert into "EMP" ("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO") values (7782,'CLARK','MANAGER',7839,to_date('1981-06-09','DD-MON-RR'),2450,null,10);
Insert into "EMP" ("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO") values (7788,'SCOTT','ANALYST',7566,to_date('1987-04-19','DD-MON-RR'),3800,null,20);
Insert into "EMP" ("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO") values (7839,'KING','PRESIDENT',null,to_date('1981-11-17','DD-MON-RR'),5000,null,10);
Insert into "EMP" ("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO") values (7844,'TURNER','SALESMAN',7698,to_date('1981-09-08','DD-MON-RR'),1500,0,30);
Insert into "EMP" ("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO") values (7876,'ADAMS','CLERK',7788,to_date('1987-05-23','DD-MON-RR'),1100,null,20);
Insert into "EMP" ("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO") values (7900,'JAMES','CLERK',7698,to_date('1981-12-03','DD-MON-RR'),950,null,30);
Insert into "EMP" ("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO") values (7902,'FORD','ANALYST',7566,to_date('1981-12-03','DD-MON-RR'),3000,null,20);
Insert into "EMP" ("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO") values (7934,'MILLER','CLERK',7782,to_date('1982-01-23','DD-MON-RR'),1300,null,10);

Similar Messages

  • Export as SQL INSERT generates dud SQL

    When I attempted to export data from a table as SQL INSERT statements it generated the statements with single quotes around the table name:
    SQL> Insert into 'JOHN_SMITH' values ('162142','89')
      2  /
    Insert into 'JOHN_SMITH' values ('162142','89')
    ERROR at line 1:
    ORA-00903: invalid table name
    SQL> Fortunately my text editor can do the necessary global replace :)
    SQL> Insert into "JOHN_SMITH" values ('162142','89')
      2  /
    1 row created.
    SQL> I am using Raptor #919
    Cheers, APC

    Wanted to clarify the table in insert - in the EA4 release, we will not wrap the table name in quotes at all, if you want to preserve multi-byte characters or mixed case table names, you need to wrap the table name in double quotes. We just removed the single quotes we had incorrectly put in. This makes it consistent with creating and modifying a table - i.e. you provide the quotes if you want them.
    -- Sharon

  • SqlDeveloper -  Import data of backup sql insert generated of Tool Export

    Hi, sorry for my bad English,
    My database is deleted, and the only export support is one that was generated prior to erase in the SQL Developer 1.5.
    But this export has:
    Insert into ORA_ASPNET_APPLICATIONS (ApplicationName, LOWEREDAPPLICATIONNAME, application, DESCRIPTION) values ('Returns', 'return', '[B @ 600f44fe', null);
    else
    Insert into "ORA_ASPNET_APPLICATIONS (ApplicationName, LOWEREDAPPLICATIONNAME, application, DESCRIPTION) values ('Returns', 'return', 'C8AD09AAE28D4961B74BA2321054212B', null);
    How decode value into value normal?
    I've tried to RawtoHEX and is not the same value.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    I'm afraid that's a bugged export rather than a coded value...
    In the future, better make periodical backups with EXPDP.
    Sorry,
    K.

  • Export "SQL Insert" problem

    Hello to everybody,
    I'm using SQL Developer 1.0.0.15.57 in an Italian Windows XP Professional SP2.
    I'm exporting a table as "SQL Insert" and I have the following problem: the exported INSERT instruction contains, i.e., 123,45 instead of 123.45 so, running the INSERT, Oracle 10 tells me too much values were given because
    Value1, 123,45, Value2, ...
    is wrong: it should be
    Value1, 123.45, Value2, ...
    I think this is a problem of the Internation settings (in Italy we use , as decimal separator instead of the . ). Does anybody know how to solve this?
    For the moment I have changed my Internal Settings with USA and, after arestart, this is fixed. However now there is another less heavy problem: the dates are written in English like to_date('01-JAN-06', ... instead of to_date('01-GEN-06', ... but I can fix it with a search&replace function.
    Thank you in advance
    Andrea

    Hello. I'm trying to find a solution for this too. In Venezuela we also use , as decimal separator. Has anybody found a solution for this? It is absolutly necesary to change the international settings of my pc?
    Thanks!
    Message was edited by:
    JeanK

  • Generate SQL Insert Statements

    Hello,
    I am testing generating insert statements for which I have a function which will return a sql statement.
    This sql statement when I execute would results as sql insert statements.
    What I am trying to acheive through a procedure is when I execute function, the result I would like to execute automatically and then the second sql I would like to store to a control file or sql file.
    How can I acheive this?
    Any help is very helpful
    Regards
    Edited by: user20090209 on Aug 20, 2009 11:34 AM

    Here is the function to generate sql
    CREATE OR REPLACE function insert_sql(v_table_name varchar2)
    return varchar2 as
    b_found boolean := false;
    v varchar2(32000);
    v1 varchar2(32000);
    v2 varchar2(32000);
    begin
    for s in (
    select *
    from all_tables
    where table_name=upper(v_table_name)
    --and owner=upper(v_owner)
    ) loop
    b_found := true;
    for ss in (
    select *
    from all_tab_columns
    where table_name = s.table_name
    order by column_id
    ) loop
    if ss.data_type='NUMBER' then
    v1:=v1||','||ss.column_name;
    v2:=v2||',''''''||to_char('||ss.column_name||')||''''''';
    end if;
    if ss.data_type in ('VARCHAR2','CHAR') then
    v1:=v1||','||ss.column_name;
    v2:=v2||',''''''||replace(replace('||ss.column_name||','''''''',''''''''''''),''&'','''')||''''''';
    end if;
    if ss.data_type='DATE' then
    v1:=v1||','||ss.column_name;
    v2:=v2||',to_date(''''''||to_char('||ss.column_name||',''dd.mm.yyyy hh:mi:ss'')||'''''',''''dd.mm.yyyy hh:mi:ss'''')';
    end if;
    end loop;
    v:='select ''insert into '||s.table_name||' (';
    v:=v||substr(v1,2,9999)||') '||chr(10)||' values ('||substr(v2,2,9999)||'); '' txt from '||s.table_name;
    end loop;
    if not b_found then
    v:='- Table ' || v_table_name || ' not found';
    else
    v:=v;
    end if;
    return v;
    end;
    /And I am calling like
    CREATE OR REPLACE PROCEDURE test_gen_script_exec IS
    type v_ref_cur is REF CURSOR;
    v_ref_cur_var v_ref_cur;
    v_temp_sql VARCHAR2(4000);
    v_sql varchar2(4000);
    begin
    v_sql := insert_sql('table_name');--change here
    open v_ref_cur_var for v_sql;
    loop
    fetch v_ref_cur_var into v_temp_sql;
    exit when v_ref_cur_var%notfound;
    execute immediate v_temp_sql;
    end loop;
    close v_ref_cur_var;
    end;
    /Edited by: user20090209 on Aug 20, 2009 1:24 PM

  • Use APEX API to export images as sql inserts

    I was wondering if it is possible to export a custom table with images as sql insert statements, using the APEX API.

    I've uploaded an image as a workspace image. When I click "display install file script" I get the following code:
    begin
    wwv_flow_api.g_varchar2_table := wwv_flow_api.empty_varchar2_table;
    wwv_flow_api.g_varchar2_table(1) := '424D92000000000000003...   etc ;
    wwv_flow_api.g_varchar2_table(2) := 'A800E9FE9800EAFE9800E...   etc ';
    end;
    declare
        l_name   varchar2(255);
    begin
        l_name := 'B73.bmp';
      wwv_flow_api.create_or_remove_file(
         p_name=> l_name,
         p_varchar2_table=> wwv_flow_api.g_varchar2_table,
         p_mimetype=> 'image/bmp',
         p_location=> 'WORKSPACE',
         p_nlang=> '0',
         p_mode=> 'CREATE_OR_REPLACE',
         p_type=> 'IMAGE');
    end;
    /How do I generate these strings to export my images.

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

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

  • SQL insert scripts generation from repository data xml file

    Hi All,
    I want to generate sql insert scripts from repository data xml file which contain <add-item>elements.
    Example: data xml file is contains
    <add-item item-descriptor="user" id="741">
    <set-property name="gender"><![CDATA[female]]></set-property>
    <set-property name="emailStatus"><![CDATA[__NULL__]]></set-property>
    <set-property name="receiveEmail"><![CDATA[__NULL__]]></set-property>
    <set-property name="email"><![CDATA[[email protected]]]></set-property>
    <set-property name="password"><![CDATA[a694cb1d6d011eddc444acb77338c1df6a22bac5de26330e2fe1d20f15f97ed6]]></set-property>
    <!-- rdonly derived <set-property name="abandonedOrderCount"><![CDATA[0]]></set-property> -->
    <set-property name="locale"><![CDATA[de_DE]]></set-property>
    <set-property name="userType"><![CDATA[1]]></set-property>
    <set-property name="autoLogin"><![CDATA[__NULL__]]></set-property>
    <set-property name="lastName"><![CDATA[Springford]]></set-property>
    <set-property name="member"><![CDATA[true]]></set-property>
    <set-property name="dateOfBirth"><![CDATA[7/18/1951 00:00:00]]></set-property>
    <!-- rdonly derived <set-property name="age"><![CDATA[61]]></set-property> -->
    <set-property name="registrationDate"><![CDATA[5/16/1996 00:00:00]]></set-property>
    <set-property name="login"><![CDATA[sally]]></set-property>
    <set-property name="lastActivity"><![CDATA[6/9/1999 00:00:00]]></set-property>
    <set-property name="homeAddress"><![CDATA[741]]></set-property>
    <set-property name="passwordSalt"><![CDATA[sally]]></set-property>
    <set-property name="generatedPassword"><![CDATA[__NULL__]]></set-property>
    <set-property name="firstName"><![CDATA[Sally]]></set-property>
    <set-property name="lastPasswordUpdate"><![CDATA[__NULL__]]></set-property>
    </add-item>
    Thanks
    Siva

    HI Rohan,
    Thanks for reply..
    I have checked the startSQLRepository script by using this we can export or import repository data from xml to repository.But in startSQLRepository there is no attribute to generate sql
    insert scripts from data xmls but there is a option to get the sql scripts(-ouputSQL).

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

  • Problem with SQL Insert

    Hi
    I am using Flex to insert data through remoteobject and using
    SAVE method generated from CFC Wizard.
    My VO contains the following variables where id has a default
    value of 0 :
    public var id:Number = 0 ;
    public var date:String = "";
    public var accountno:String = "";
    public var debit:Number = 0;
    public var credit:Number = 0;
    id is set as the primary key in my database.
    I have previously used MySQL which automatically generates a
    new id if I either omitted the id value in my insert statement or
    use 0 as the default value.
    However, now I am using MS SQL Server and the insert
    generated this error:
    Unable to invoke CFC - Error Executing Database Query.
    Detail:
    [Macromedia][SQLServer JDBC Driver][SQLServer]Cannot insert
    explicit value for identity column in table 'Transactions' when
    IDENTITY_INSERT is set to OFF.
    Strange thing is that I dont see this problem with another
    sample application. I compared with that application (it has the
    same VO with default value of 0 for id) and everything looks
    similar so I can't understand why I have this error in my
    application.
    This is SQL used to create the table:
    USE [Transactions]
    SET ANSI_NULLS ON
    SET QUOTED_IDENTIFIER ON
    SET ANSI_PADDING ON
    CREATE TABLE [dbo].[Transactions](
    [id] [int] IDENTITY(1,1) NOT NULL,
    [date] [datetime] NULL,
    [accountno] [varchar](100) NULL,
    [debit] [int] NULL,
    [credit] [int] NULL,
    CONSTRAINT [PK_Transactions] PRIMARY KEY CLUSTERED
    [id] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE =
    OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON,
    ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    Has anyone encountered this problem before with insert
    statements dealing with a unique id (with MS SQL Server)?

    Change "addRecords =
    connection.prepareStatement("
    to "addRecords =
    connection.preparedStatement("
    -BIGD

  • Help with exporting document and generating an enumerated value error

    Can anyone help me figure out why I cannot get this script to export the document and save it for the web?
    I keep getting the same frustrating "Enumerated Value expected".
    here is the script thus far:
    * attempting to create a script to insert names automatically within photoshop cs2. Similar to the PSP.
    tag = app.activeDocument;
    var lee = ["Barb","Belle","Betty","Carmel","Christy","Connie",
    "Debbie","Debra","Denise","Diamond","Dolceluna","Irene","Jacqui"];
    //determine if active layer is a text layer or not.
    if(tag.isBackground == true){
    alert("this is a background layer and cannot be changed.");
    else{
    alert("this is the name layer.")
    for(i=0;i<lee.length;i++){
    tag.activeLayer.textItem.contents = lee[i];
    var options = new ExportOptionsSaveForWeb();
    options.format = SaveDocumentType.PNG-24;
    options.interlaced = false;
        options.PNG8= false;
    var fName = lee[i];
    var newName = fName+'-'+tag.name+'.png';
    alert(newName);
    //EXPORT DOCUMENT KEEPS GENERATING ENUMBERATED VALUE EXPECTED
    // web.matte = MatteType.NONE;
    tag.exportDocument(File(tag.path + '/' + newName),ExportType.SAVEFORWEB,options);
    } // closes for loop
    }// end of else statement

    Yes the guide is misleading. It says 'For this property, only COMPUSERVEGIF, JPEG, PNG-8, PNG-24, and BMP are supported.'
    It really should say 'For this property, only COMPUSERVEGIF, JPEG, PNG, and BMP are supported.'
    But if you look under SaveDocumentType you will not find PNG-8 or PNG-24 listed in the values.

  • How I can make SQL Insert file on schedule

    Dear Community Members;
    Hope all you will be perfect. I required your urgent response on my query. I want to make an SQL Insert file, means I want to insert data from query in one table and after that, the data export in an SQL file as a SQL Insert file.
    All these things want to do on schedule not manually.
    Can anyone help and guide me how I can do it?

    Dear Members;
    Actually, we are working on two different applications, like sale and account. Now we want to post sale information in account system without any DBLink, for that I want to make a file where my data store in SQL Insert Statement format on scheduling, means I want to create a procedure which create this file on scheduling. After that same as I want to create a procedure in other system for read that file and execute. Now I have been found Oracle functionality but still I am facing a problem. The problem is that my procedure create a file with a single record not the all fetched record. My Procedure is as:
    DECLARE
      fileHandler UTL_FILE.FILE_TYPE;
      INSERT1 VARCHAR2(200);
      INSERT2 VARCHAR2(200);
      cursor c1 is
        select T.QTY, T.SLIP_NO, T.STORE_NO, T.Item_Code
        from test t
        where T.STORE_NO = 1;
    BEGIN
        for cur_rec in c1 loop
        INSERT1 := 'INSERT INTO TEST_2(Item_Code,STORE_NO,QTY,SLIP_NO) VALUES(';
        INSERT2 := INSERT1||CUR_REC.Item_Code||','||CUR_REC.STORE_NO||','||CUR_REC.QTY||','||CUR_REC.SLIP_NO||')' ;
      fileHandler := UTL_FILE.FOPEN('E:\Oracle\admin\udump', 'test_file2.SQL', 'W');
      --UTL_FILE.PUTF(fileHandler, 'Writing TO a file\n');
      UTL_FILE.PUTF(fileHandler, INSERT2);
      UTL_FILE.PUTF(fileHandler, '\n commit;');
      UTL_FILE.FCLOSE(fileHandler);
      END LOOP;
    EXCEPTION
      WHEN utl_file.invalid_path THEN
         raise_application_error(-20000, 'ERROR: Invalid PATH FOR file.');
    END;
    Please suggest/guide me where I am doing something wrong or missing. I'll thankful for your help.

  • Improving SQL Insert statement syntax

    It's about insert statement syntax, in insert statement, unlike in update statement column names and corresponding values are separated in two different sets. With this separation debugging/writing of insert statement is going to be time taking activity. To identify what value is getting stored in any column, first column position needs to be identified and after that by counting commas in the values list value is located. If functions are included in insert statement then counting of commas doesn't help to locate the value.
    In any non trivial application column count in insert statement is going to be very big number and it is unmanageable.
    If column name and value are written next to each other as it is done in cause of UPDATE statement, it is going to drastically reduce the debugging efforts and there by improves the productivity of the developers.
    So I request SQL community please consider having a variant of insert statement in similar lines of update statement. This will simplify the life of millions of developers.
    Edited by: user9110509 on Feb 6, 2010 10:19 AM

    Hi,
    That's a good idea! An optional alternate way of specifying the columns would be handy.
    Perhaps the reason it hasn't been done yet is that most people, like those who have responded to this message, do not find the current syntax much of a problem. We can't be sure if your idea "is going to drastically reduce the debugging efforts" until it is available, but my guess is that it isn't.
    One thing I do to make sure the two lists match is to indent the values directly below the column names, like this:
    INSERT INTO emp (empno, ename,   hiredate,                job)
          VALUES (9876,  'OBAMA', TO_DATE ( '20-JAN-2009'
                              , 'DD-MON-YYYY), 'PRESIDENT');If the list is very long, or individual values are very complicated, then I might start with a list of the column names
    INSERT INTO emp          -- Step 1: not ready to run yet
    (     empno
    ,     ename
    ,     hiredate
    ,     job
    VALUESthen use the editor's copy and paste commands to duplicate that list:
    INSERT INTO emp          -- Step 2: not ready to run yet
    (     empno
    ,     ename
    ,     hiredate
    ,     job
    VALUES
    (     empno
    ,     ename
    ,     hiredate
    ,     job
    ;and then fill in the VALUES section, leaving the copied names as comments:
    INSERT INTO emp          -- Step 3: ready to run
    (     empno
    ,     ename
    ,     hiredate
    ,     job
    VALUES
    (     9876               -- empno
    ,     'OBAMA'               -- ename
    ,     TO_DATE ( '20-JAN-2009'
              , 'DD-MON-YYYY
              )          -- hiredate
    ,     'PRESIDENT'          -- job
    ;

  • SQL insert with select statement having strange results

    So I have the below sql (edited a bit). Now here's the problem.
    I can run the select statement just fine, i get 48 rows back. When I run with the insert statement, a total of 9062 rows are inserted. What gives?
    <SQL>
    INSERT INTO mars_aes_data
    (rpt_id, shpdt, blno, stt, shpr_nad, branch_tableS, csgn_nad,
    csgnnm1, foreign_code, pnt_des, des, eccn_no, entity_no,
    odtc_cert_ind, dep_date, equipment_no, haz_flag, schd_no,
    schd_desc, rec_value, iso_ulti_dest, odtc_exempt, itn,
    liscence_no, liscence_flag, liscence_code, mblno, mot,
    cntry_load, pnt_load, origin_state, airline_prefix, qty1, qty2,
    ref_val, related, routed_flag, scac, odtc_indicator, seal_no,
    line_no, port_export, port_unlading, shipnum, shprnm1, veh_title,
    total_value, odtc_cat_code, unit1, unit2)
    SELECT 49, schemaP.tableS.shpdt, schemaP.tableS.blno,
    schemaP.tableS.stt, schemaP.tableS.shpr_nad,
    schemaP.tableM.branch_tableS, schemaP.tableS.csgn_nad,
    schemaP.tableS.csgnnm1, schemaP.tableD.foreign_code,
    schemaP.tableS.pnt_des, schemaP.tableS.des,
    schemaP.tableD.eccn_no, schemaP.tableN.entity_no,
    schemaP.tableD.odtc_cert_ind, schemaP.tableM.dep_date,
    schemaP.tableM.equipment_no, schemaP.tableM.haz_flag,
    schemaP.tableD.schd_no, schemaP.tableD.schd_desc,
    schemaP.tableD.rec_value,
    schemaP.tableM.iso_ulti_dest,
    schemaP.tableD.odtc_exempt, schemaP.tableM.itn,
    schemaP.tableD.liscence_no,
    schemaP.tableM.liscence_flag,
    schemaP.tableD.liscence_code, schemaP.tableS.mblno,
    schemaP.tableM.mot, schemaP.tableS.cntry_load,
    schemaP.tableS.pnt_load, schemaP.tableM.origin_state,
    schemaP.tableM.airline_prefix, schemaP.tableD.qty1,
    schemaP.tableD.qty2,
    schemaC.func_getRefs@link (schemaP.tableS.ptt, 'ZYX'),
    schemaP.tableM.related, schemaP.tableM.routed_flag,
    schemaP.tableM.scac, schemaP.tableD.odtc_indicator,
    schemaP.tableM.seal_no, schemaP.tableD.line_no,
    schemaP.tableM.port_export,
    schemaP.tableM.port_unlading, schemaP.tableS.shipnum,
    schemaP.tableS.shprnm1, schemaP.tableV.veh_title,
    schemaP.tableM.total_value,
    schemaP.tableD.odtc_cat_code, schemaP.tableD.unit1,
    schemaP.tableD.unit2
    FROM schemaP.tableD@link,
    schemaP.tableM@link,
    schemaP.tableN@link,
    schemaP.tableS@link,
    schemaP.tableV@link
    WHERE tableM.answer IN ('123', '456')
    AND SUBSTR (tableS.area, 1, 1) IN ('A', 'S')
    AND entity_no IN
    ('A',
    'B',
    'C',
    'D',
    'E',
    AND TO_DATE (SUBSTR (tableM.time_stamp, 1, 8), 'YYYYMMDD')
    BETWEEN '01-Mar-2009'
    AND '31-Mar-2009'
    AND tableN.shipment= tableD.shipment(+)
    AND tableN.shipment= tableS.shipnum
    AND tableN.shipment= tableM.shipment(+)
    AND tableN.shipment= tableV.shipment(+)
    <SQL>
    Edited by: user11263048 on Jun 12, 2009 7:23 AM
    Edited by: user11263048 on Jun 12, 2009 7:27 AM

    Can you change this:
    BETWEEN '01-Mar-2009'
    AND '31-Mar-2009'To this:
    BETWEEN TO_DATE('01-Mar-2009', 'DD-MON-YYYY')
    AND TO_DATE('31-Mar-2009','DD-MON-YYYY')That may make no difference but you should never rely on implicit conversions like that, they're always likely to cause you nasty surprises.
    If you're still getting the discrepancy, instead of and INSERT-SELECT, can you try a CREATE TABLE AS SELECT... just to see if you get the same result.

Maybe you are looking for