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

Similar Messages

  • 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);

  • SQL INSERT problem - help please

    Hello,
    I'm having a problem with INSERT statement.
    There is a "ShowFinal.jsp" page, which is a list of candidates who selected from the second
    interview. The user picked some candidates from the list and conduct the 3rd interview. After
    he check suitable candidates(who are selected from the 3rd interview) from the list , enter
    basic salary for every selected candidate, enter date of interview and finally submit the form.
    These data should be save into these tables.
    FinalSelect(nicNo,date)
    EmpSalary(nicNo,basicSal)
    In this "ShowFinal.jsp" page, it validates the following conditions using JavaScript.
    1) If the user submit the form without checking at least one checkbox, then the system should be
    display an alert message ("Please select at least one candidate").
    2) If the user submit the form without entering the basic salary of that candidate which was
    checked, then the system should be display an alert message ("Please enter basic salary").
    These are working well. But my problem is how to wrote the "AddNewFinal.jsp" page to save these
    data into the db.
    Here is my code which I have wrote. But it points an error.
    "AddNewFinal.jsp"
    String interviewDate = request.getParameter("date");
    String[] value = request.getParameterValues("ChkNicno");
    String[] bs = request.getParameterValues("basicSal");
    String sql ="INSERT INTO finalselect (nicNo,date) VALUES(?,?)";
    String sql2 ="INSERT INTO EmpSalary (nicNo,basicSal) VALUES(?,?)";
    for(int i=0; i < value.length; i++){
         String temp = value;     
         for(int x=0; x < bs.length; x++){
              String basic = bs[x];
              pstmt2 = connection.prepareStatement(sql2);
              pstmt2.setString(1, temp);
              pstmt2.setString(2, basic);
              int RowCount1= pstmt2.executeUpdate();
         pstmt1 = connection.prepareStatement(sql);
         pstmt1.setString(1, temp);
         pstmt1.setString(2, interviewDate);
         int RowCount= pstmt1.executeUpdate();
    Here is the code for "ShowFinal.jsp".
    <form name="ShowFinal" method="POST" action="AddNewFinal.jsp" onsubmit="return checkEmpty() &&
    ValidateDate();">
    <%--  Loop through the list and print each item --%>
    <%
         int iCounter = 0; //counter for incremental value
         while (igroups.hasNext()) {
              Selection s = (Selection) igroups.next();
              iCounter+=1; //increment
    %>
    <tr>
         <td style="background-color:ivory" noWrap width="20">
         <input type="checkbox" name="<%= "ChkNicno" + iCounter %>"      
    value="<%=s.getNicno()%>"></td>
            <td style="background-color:ivory" noWrap width="39">
                 <%= s.getNicno() %>  </td>
         <td style="background-color:ivory" noWrap width="174">
              <input type="text" name="<%= "basicSal" + iCounter %>" size="10"> </td>
    </tr>
    <%
    %>
    Date of interview<input type="text" name="date" size="17"></td>
    <input type="submit" value="APPROVE CANDIDATE" name="B1" style="border: 1px solid #0000FF">
    </form>........................................................
    Here is the error generated by TOMCAT.
    root cause
    java.lang.NullPointerException
         at org.apache.jsp.AddNewFinal_jsp._jspService(AddNewFinal_jsp.java:70)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
    I have goto the file "AddNewFinal_jsp.java". The line 70 points to the following line.
    for(int i=0; i < value.length; i++){ [/b]
    Please can someone help me to solve this problem? Please help me to do this task.
    Thanks.

    Hi Casabianca ,
    It is clearly that your problem is not on the database end, more like a servlet/jsp issue.
    I will not comment on the javascript portion, but rather the 2 jsps.
    a simple way to trace what's go wrong is to check the final result (the html code) of the first jsp (showFinal.jsp), and compare against what is expected by the 2nd jsp (AddNewFinal.jsp). Most browser do provide "view source" on the page visited.
    the following code
    <input type="checkbox" name="<%= "ChkNicno" + iCounter %>" value="<%=s.getNicno() %>">
    <input type="text" name="<%= "basicSal" + iCounter %>"
    would likely to be "translated" to html code something as follow:
    <input type="checkbox" name=""ChkNicno0" value="nicNo>">
    <input type="text" name="basicSal0">
    the original code in "AddNewFinal.jsp" using
    request.getParameterValues("ChkNicno");
    which looking for a none exist http request parameter (sent as "ChkNicno0",etc but look for "ChkNicno"), which has explained before.
    the second attempt to use String[] value = request.getParameterValues("ChkNicno" + iCounter); give Cannot resolove symbol :iCounter. because iCounter never defined in the 2nd jsp!
    Most of the error message do give clue to cause of error... : )
    not too sure on your intension, assume you wish to update only those selected (checked) row to db.
    some suggestions:
    1) <input type="text" name="ChkNicno" size="10"> </td>...
    <input type="text" name="basicSal" size="10"> instead.
    then use javascript to based on checked element index (refer to javascript spec for more details), for those index not checked, clear off the correspond index "basicSal" field value.
    e.g. ChkNicno[1] is not checked, empty basicSal[1] value before submission.
    This will give us only selected rows values.
    2) retain the code
    String[] value = request.getParameterValues("ChkNicno");
    String[] bs = request.getParameterValues("basicSal");at 2nd jsp, as now the http request will pass parameters using "ChkNicno" and "basicSal".
    3) some change to the code for optimization
    for(int i=0; i < value.length; i++){
         String temp = value;     
         for(int x=0; x < bs.length; x++){
              String basic = bs[x];
              pstmt2 = connection.prepareStatement(sql2);
              pstmt2.setString(1, temp);
              pstmt2.setString(2, basic);
              int RowCount1= pstmt2.executeUpdate();
         pstmt1 = connection.prepareStatement(sql);
         pstmt1.setString(1, temp);
         pstmt1.setString(2, interviewDate);
         int RowCount= pstmt1.executeUpdate();
    to
    pstmt1 = connection.prepareStatement(sql);
    pstmt2 = connection.prepareStatement(sql2);
    for(int i=0; i < value.length; i++){
         String temp = value;     
         for(int x=0; x < bs.length; x++){
              String basic = bs[x];
              pstmt2.setString(1, temp);
              pstmt2.setString(2, basic);
              int RowCount1= pstmt2.executeUpdate();
         pstmt1.setString(1, temp);
         pstmt1.setString(2, interviewDate);
         int RowCount= pstmt1.executeUpdate();
    preparestatement created once should be sufficient as we do not change the sql statement throughout the loop.
    there are better solutions out there, this just some ideas and suggestions.Do try out if you wish.
    Hope it helps. : )

  • Sql - Insert problem in MsAccess

    Hello!!!
    J have problem with INSERT function, I use MsAccessm as database. My query is :
    INSERT INTO [Produkty-www] ( Id,Nazwa,Kod,Cena)
    VALUES 6646545,"Zlaczka
    prosta 22mm 1/2 ' z (KRoCIEC)",'JGK22-1/2Z',10.00)
    this is very import symbol ' in 1/2 ' z must be at the place. When I execute this query I have exception. In maaccess I create query and also msaccesse show me when is the bad part of query the sybmol ' is underline.
    So I create a new query but in access :
    INSERT INTO [Produkty-www] ( Id,Nazwa,Kod,Cena) VALUES (6646545,"Zlaczka prosta 22mm 1/2 ' z (KRoCIEC)",'JGK22-1/2Z',10.00)
    and ok access add record, now I copy this query to my java application and I also have exception.
    Why this query don`t work.. ?

    Ok, it`s done :     
    PreparedStatement statement = podlaczenie.prepareStatement("INSERT INTO [Produkty-www] (id, Nazwa, Kod, Cena) VALUES (?,?,?,?)");
    statement.setInt(1,2);
    statement.setString(2,"ffsdfds'fdsfs");
    statement.setString(3,"kod");
    statement.setInt(4,124);
    statement.execute();
    But I need a sql query print to console, a search a method of statement but I dont find that I look for, it is some method that give my sql query in string ?
    Thank`s for help

  • 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

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

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

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

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

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

  • SQL insert statement in java with Excel file

    Dear all,
    I wrote a program is as the follow:
    import java.io.*;
    import java.sql.*;
    public class handleExcel
         Connection con = null;
         Statement stmnt = null;
         public handleExcel()
              String excel = "C:\\EGS\\app_files\\info_update_form_exported_data.xls";
              try
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   String str="jdbc:odbc:DRIVER=Microsoft Excel Driver (*.xls);DBQ=" + excel + ";";
         String sql = "insert into [Sheet1$] (Name, Age, Test1, Test2, Test3) values ('mary','16','aa','bb','vv')";
                   con = DriverManager.getConnection(str, "", "");
                   stmnt = con.createStatement();
                   stmnt.executeUpdate(sql);
              catch(Exception e)
                   System.out.println("con is error!!");
                   e.printStackTrace();
         public static void main(String[] args)
              handleExcel TestHpc = new handleExcel();
    But when I run it, the error is as the follow:
    java.sql.SQLException: [Microsoft][ODBC Excel Driver]
         at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6958)
         at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7115)
         at sun.jdbc.odbc.JdbcOdbc.SQLExecDirect(JdbcOdbc.java:3111)
         at sun.jdbc.odbc.JdbcOdbcStatement.execute(JdbcOdbcStatement.java:338)
         at sun.jdbc.odbc.JdbcOdbcStatement.executeUpdate(JdbcOdbcStatement.java:288)
         at hk.gov.edb.util.handleExcel.<init>(handleExcel.java:31)
         at hk.gov.edb.util.handleExcel.main(handleExcel.java:97)
    Please help me to solve this problem. Thank you so much for your help!
    Regards,
    kzyo

    Hi
    You can use the[b] jakarta POI api in order to read/write Excel file from java. Pure Java, no drivers nedeed.
    I tested and ok.
    Hope this helps

  • An insert problem

    hi
    i am inserting in a table values like-----
    insert into tab1(col1) values(seq.nextval);
    my col1 of tab1 is of varchar2(20) datatype and seq is a sequence.
    now an error is coming
    PL/SQL: ORA-00984: column not allowed here
    why??

    does not look like any error here...
    14:14:07 SQL> CREATE TABLE tab1 (col1 VARCHAR2(20));
    Table created.
    Elapsed: 00:00:00.00
    14:14:20 SQL> CREATE SEQUENCE seq START WITH 1 INCREMENT BY 1;
    Sequence created.
    Elapsed: 00:00:00.00
    14:14:46 SQL> INSERT INTO tab1(col1) VALUES(seq.NEXTVAL);
    1 row created.
    Elapsed: 00:00:00.00
    14:15:06 SQL> SELECT * FROM tab1;
    COL1
    1
    Elapsed: 00:00:00.00
    14:15:13 SQL> INSERT INTO tab1(col1) VALUES(seq.NEXTVAL);
    1 row created.
    Elapsed: 00:00:00.00
    14:15:22 SQL> SELECT * FROM tab1;
    COL1
    1
    2
    Elapsed: 00:00:00.00can you give more details about your problem, desc of your table, name of the sequence etc...

  • Exporting SQL data to Excel 2010 files - Excel sets all columns to DT_WSTR, ignores numeric or currency

    It looks like this has been a problem since forever, but I'm hoping someone has a solution.  I'm exporting SQL data to an .xlsx file.  I have the columns in my query set to the appropriate values, e.g. SELECT Cast(column1 AS nvarchar()) 'column1',
    Cast(column2 as currency) 'column2'.  I have a spreadsheet and I've set the data type for each column.  I have an OLEDB connection manager with the connection string of
    Data Source=C:\MyFile.xlsx;Provider=Microsoft.ACE.OLEDB.12.0;Extended Properties="Excel 12.0;";  When I look at the Advanced Editor of my OLE DB Destination Component, I see that all the Input Columns are of the correct datatype, but
    all the External Columns are of datatype DT_WSTR.  
    How can I get my numeric, currency, date fields to be written to Excel as numeric, currency, date?  Right now they all get written as text, any numbers get single quotes put in front of them so they are treated as text.  
    I'm using SSIS 2008 R2.
    I don't get it, SQL and Excel are both Microsoft, why is it so hard to get them to work together?!

    Hi,
    converting to DT_WSTR because you are converting this into nvarachar in your select statement in oledb source.
    are you looking into the oledb destination or Excel destination for data types.
    please remove the casting from your select and create the new table as showing in the following snapshot:
    http://zaimraza.wordpress.com/

  • Oracle insert problem(records not in the order they are inserted)

    hi, all:
    I tried to insert a word list into a oracle table, everything is fine except that the words are not in the order they are inserted. For example, the words are inserted in the following sequence:
    accreted     
    accreting     
    accretion     
    accretionary     
    accretive     
    bladebone
    bladed     
    bladeless
    bladelike
    When I retrived the resultset from the table and iterate through each of the record, the words are not in the order inserted, i.e., it may look like this,
    accreted     
    accreting     
    bladebone
    bladed     
    accretion     
    accretionary     
    accretive     
    bladeless
    bladelike
    This strange phenomenon won't happen when the word list is small, like 500 words or so, but when the number of words reaches around 10,000, it takes place. My coworker also experienced this problem when trying to insert large volume of data into oracle table.
    The code I used to insert into the DB table:
    BufferedReader reader=new BufferedReader(new FileReader("C:\\Dictionary.txt"));
    while( (line=reader.readLine())!=null )
         sql="INSERT INTO DICT " +
         "VALUES ('" + line +"')";                         
         statement.executeUpdate(sql);
    Any advice will be highly appreciated,
    thanks

    Well, the best thing to do is follows scsi-boy's advice and add the additional column and either put a sequence number in it from the Java side as you insert, or use an Oracle sequence object to put a sequence number in it from the Oracle side (which is sort of like an auto-generated value, but different).
    Note that an Oracle sequence generates numbers in sequence, but possibly with gaps (usually if the database is rebooted), unless you do some things that slow sequences down substantially. Sequences can also be something of a bottleneck on RAC clusters. See:
    http://www.dizwell.com/oracle/articles/autonumbering.html
    However, if your coworker is commiting after each and every insert (which is bad form and slows the database down, -10 points), and if your coworker is also never ever ever updating the columns after they've been inserted, and if your coworker is using Oracle 10g and not some older version such as 9i, then your coworker could use the ORA_ROWSCN pseudo-column to order by. Those are very very severe constraints and you shouldn't begin to consider doing it that way without a very good reason, and right now you and your coworker wouldn't know a good reason if it snuck up and bit you on the butt, you've got a lot of learning the basics first.

  • 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

  • DNS problem on WIndows Server 2008 R2

    Dear All I have windows 2008 R2 Server which is a DOmain Controller for a Domain. It is also DNS server. We are using Class A ip addresses for the private LAN behind a firewall. The DC & DNS Server has IP address of 80.5.0.1.  The CLient machines in

  • Cannot save file after it is digitally signed

    Hello, I work for the IT Dept at my company and one of our employees is having trouble saving PDF files after digitally signing them.  He received the error message: The document could not be saved.  Can not save to this file name.  Please save the d

  • Excel rendering not correctly for SQL SERVER 2012 (and reporting server)

    hi I have a tablix that has a category, subcategory and total items column. The total items are grouped into subcategories which are in turn grouped into categories. When using the wizard we explicitly indicate that the subtotals and totals should NO

  • Add new field in me28

    Hi all I want to add a new field(PO cretor) in the selection screen of me28. Is there a screen exit or any other method to achieve this requirement. Regards Navjot

  • Add lines to PDF script using cs2?

    Hell all, I've imported a PDF film script into Photoshop CS2 with the intent of adding lines and such to the script (part of lining a script and script breakdown). I was wondering what the best method is for adding lines. I've done some research and