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

Similar Messages

  • Insert statement not work for Excel file

    Hi,
    In my JDBC application, I have a "INSERT ..." statement to add a new recode to a Excel file. When I run this application, the statement is executed successfully(no Exception), however the excel file doesnot change at all.
    I am still able to run "SELECT ..." from the excel file, I am really confused.
    Anybody could help me on this?
    Thanks.

    How do you see that the Excel file hasn't changed?
    Do a select on the new record?
    Open / Reopen with Excel?
    Look at the file size?
    What if you close your connection? Is a change apparent then?

  • INSERT statement in Java and MS Access

    Hi all,
    can anyone please tell me how to insert data to an MS Access table using JSP i tried INSERT statement of java but it is getting errors saying INSERT statement is wrong. I have no idea about MS access insert statement. i am totally tired of this. Please someone help me.

    Hello,
    MS Sql can cause problems where it goes off standard, however I dont think insert is any different.
    INSERT INTO table_name (column1, column2) VALUES (variable1, variable2)
    Make sure your table and column names are exactly right, Java is case sensitive, so make sure the case is correct also.
    The other common error is if you have a required field in the database that is not populated by your program, so, if for instance there was a column3 in the table for the above example, which was a required field, the sql would fail as there is no data being entered for column3.

  • 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

  • A serious issue with excel file read in ODI

    hi gurus,
    Issue with excel file read is that we can read only one file by setting the path from ODBC Data Source Administrator-->System DNS -->Select Work book
    what i want to read the dynamic path(Every time I cant go back and set the Work book to select the excel file..
    So i came up with a solution to write a Vbscript that convert the excel to csv my problem got solved for dynamic paths the script is as follow:
    Set objArgs = WScript.Arguments
    For I = 0 to objArgs.Count - 1
    FullName = objArgs(I)
    FileName = Left(objArgs(I), InstrRev(objArgs(I), ".") )
    Set objExcel = CreateObject("Excel.application")
    set objExcelBook = objExcel.Workbooks.Open(FullName)
    objExcel.application.visible=false
    objExcel.application.displayalerts=false
    objExcelBook.SaveAs FileName & "csv",23
    objExcel.Application.Quit
    objExcel.Quit
    Set objExcel = Nothing
    set objExcelBook = Nothing
    Next
    Now this script convert the xls file to csv with comma seprated values
    e.g in excel sheet if data is ABC XYZ PQR
    csv will come with ABC,XYZ,PQR
    here the delimiter is , i want the delimiter as pipe | who's ascii code is 124
    but if i change 23 with 124 its not working i getting the error cannot save as...
    can anyone tell me that what should be the correct code for pipe
    so that the output is ABC|XYZ|PQR
    AS WE CAN USE THE SCRIPTS IN TOOLS
    Edited by: 789141 on Sep 14, 2010 11:33 PM

    I dont have the answer for your question but i have different approach in handling multiple Excel File.
    Step 1. Copy a sample source Excel File and Call it Final.xls .
    Step 2. Map this Final.xls to DSN and in Topology call this Final.xls
    Step 3. Do the Reversing and Map and test the Interface . Once its done.
    Step 4. Create a Package and using a http://odiexperts.com/?p=1426 get the list of all the Excel File
    Step 5 . Using this http://odiexperts.com/?p=273 create a Loop to Read the Excel File name
    Step 6 . Copy using OdiFileCopy to Final.xls and run your interface .
    Step 7. Increment the Loop and copy your next File for Final and run the interface
    Step 8 . Finally you will be able to read all the Excel File .
    Step 9 . Delete the source file [ Optional ]
    Hope this helps.

  • Forms6i interface with Excel file

    I want to interface forms6i with excel file.
    Through Forms 6i read data from an excel file and load to oracle tables.

    Hi
    I'd agree that probably the best approach is to save the Excel file into a delimited file (maybe a comma-separated file) and read it in from there.
    Reading a file using TEXT_IO is fine as long as the table isn't very large. Anything beyond a few hundred records, I'd strongly suggest using SQLLoader, as it is massively quicker and you don't have to go to the trouble of writing a routine to parse the line you've read in to split it up into its constituent fields.
    If you do go down the route of reading lines in using TEXT_IO, you might find a routine like this useful:
    PROCEDURE Get_Next_Field (record_in        IN     VARCHAR2,
                              current_position IN OUT NUMBER,
                              next_field       OUT    VARCHAR2,
                              separator        IN     VARCHAR2) IS
    current_letter VARCHAR2(1);
    BEGIN
        LOOP
            current_letter := SUBSTR(record_in, current_position, 1);
            current_position := current_position + 1;        
            IF  current_letter <> separator THEN
                   next_field := next_field || current_letter;
            ELSE
                   EXIT;
            END IF;
        END LOOP;
        --Trim off any enclosing characters
        next_field := LTRIM(next_field, '"');
        next_field := RTRIM(next_field, '"');
    END;You can then call this procedure with a series of calls like this to get your values out of the line of text:
    Get_Next_Field(line_in, current_position, field1, :separator);
    Get_Next_Field(line_in, current_position, field2, :separator);(...where line_in is the line you've just read from your file, current_position is a number to show where you've got to in the line, field1 is the variable to hold the value you split out of the line and :separator is just that, maybe a comma character.)
    Hope this helps
    regards
    Andrew
    UK

  • End the result of an sql query by Email as an excel file attachement

    Hi,
    I would like to create a PL/SQL function that send the result of an sql query by Email as an excel file attachement.
    i'm newbie in pl/sql an d i dont know if it's possible to do such task.
    regards,

    i think a regular expression is he way to go in your case...
    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com

  • Email attachment problems with "excel" files.

    I have just upgraded to the iphone 4 from the 3gs and since doing so any emails I receive with excel files attached will not open the attachment? These files openened with no problem on the same email account on my 3gs.
    Instead when I download the attachment and go to open it I am met with a page displaying....
    "Unable to read document.
    An error occured while reading the document."
    Has anyone else having this problem or even better anyone know what the fix is to get these files showing up?
    Any help would be appreciated,
    Kris

    After much frustration about excel files not opening and repeatedly not getting answers from apple, I think I might have found another way. It seems that the new apple OS does not support older versions of excel. By saving the excel file in question (Save As) to "Microsoft Excel 2007 Workbook" the Workbook opens just fine as an E-mail attachment. If you have macro's you can save as "Microsoft Excel 2007 Workbook (Macro Enabled)" and it works also.
    The Workbook in question as far as I was concerned was created in Microsoft Excel 2003.
    Hope this helps
    Apple needs to get on the ball. This was almost a dealbreaker with me.
    Android is looking better and better every day.

  • What apple software allows me to open and work with excel files?

    What Apple software allows me to open and work with Excel files?

    Numbers, OpenOffice, Microsoft Office 2008 or newer, or similar products. Microsoft Office 2004 doesn't work in 10.7.
    (86805)

  • How to convert XML content into SQL INSERT statements

    Hi all,
    I'm very new to XML. Forgive me if I don't use technical XML terms. :-)
    We are planning to convert SQL queries into XML format using a third party tool.
    After that we have to read the XML files and use the tokens to insert into custom tables.
    So, basically we have to create INSERT statements using the data stored in the XML file.
    How do we go about reading / parsing the XML file in Java?
    Pls help!
    Regards,
    Sam

    This is the requirement with an example.
    eg. if the following SQL query is fed into the 3rd party system,
    select last_name,job_id,salary from employees a, deptno b
    where a.deptno = b.deptno
    the output would be,
    <?xml version="1.0" ?>
    <sqlscript dbvendor="MSSQL">
    <fullselectstmt nestlevel="0">
    <subselectstmt><selectclause><fieldlist>
    <field><fieldname>
    <attr>
    <sourcetoken toketype="" dbobjtype="field">last_name</sourcetoken>
    </attr>
    </fieldname>
    </field>
    <field><fieldname>
    <attr>
    <sourcetoken toketype="" dbobjtype="field">job_id</sourcetoken>
    </attr>
    </fieldname>
    </field>
    <field><fieldname>
    <attr>
    <sourcetoken toketype="" dbobjtype="field">salary</sourcetoken>
    </attr>
    </fieldname>
    </field>
    </fieldlist></selectclause>
    <fromclause><joinlist><join nestlevel="0">
    <lztable><simpletable><attr>
    <sourcetoken toketype="" dbobjtype="table">employees</sourcetoken>
    </attr><aliasclause withas="false"><sourcetoken toketype="" dbobjtype="table alias">a</sourcetoken></aliasclause></simpletable></lztable></join><join nestlevel="0">
    <lztable><simpletable><attr>
    <sourcetoken toketype="" dbobjtype="table">deptno</sourcetoken>
    </attr><aliasclause withas="false"><sourcetoken toketype="" dbobjtype="table alias">b</sourcetoken></aliasclause></simpletable></lztable></join></joinlist></fromclause>
    <whereclause><expression exprtype="Expr_Comparison" exproop="="><attr>
    <sourcetoken toketype="" dbobjtype="table alias">a</sourcetoken>
    <sourcetoken toketype="" dbobjtype="unknown">.</sourcetoken>
    <sourcetoken toketype="" dbobjtype="field">deptno</sourcetoken>
    </attr><attr>
    <sourcetoken toketype="" dbobjtype="table alias">b</sourcetoken>
    <sourcetoken toketype="" dbobjtype="unknown">.</sourcetoken>
    <sourcetoken toketype="" dbobjtype="field">deptno</sourcetoken>
    </attr></expression>
    </whereclause></subselectstmt></fullselectstmt>
    </sqlscript>
    So, using the output file, the list of columns (under token "field") last_name,job_id and salary should be inserted into LIST_COLUMNS table. So 3 INSERT statements should be created for 3 columns.
    The list of tables (under token "table") employees and dept should be inserted into LIST_TABLES table. So 2 INSERT statements should be created for the 2 tables.
    Regards,
    Sam

  • SQL Insert Statement Data Type Mismatch Error

    I am doing a very simple web application that has a Microsoft Access database as the data source. I have been able to sucessfully create update and query statements using parameters but am having issues with an insert statement. I am using JSTL 1.1.2
    The following code creates the data type mismatch error.
    <sql:update
         sql="insert into tblTtoF(TFToolID,TFFeatID) values(?,?)">
            <sql:param value='$(ID}'/>
         <sql:param value='${feature}'/>
            </sql:update>The table has NUMBER as the data type for both of these fields and the variables I am feeding into it are both numbers. If I hard code the first number into the sql statement then it works. I have tried swapping the variables around and as long as the first one is hard coded the parameter for the second one works no matter which is first or second.
    However I can get the following code to work, which of course leaves me vulnerable to sql injection attacks which is not really a good thing.
    <sql:update>
         insert into tblTtoF(TFToolID,TFFeatID) values('<c:out value="${ID}"/>','<c:out value="${feature}"/>')
            </sql:update>So I am just looking for any suggestions as to why my first piece of code doesn't work seeing as it is the simplest of SQL statements and the most standard syntax.
    Thanks

    I changed it to the following
         <c:set var="featurenew" value="${0 + feature}"/>
         <c:set var="IDnew" value="${0 + param.toolID}"/>
              <sql:update
              sql="insert into tblTtoF(TFToolID,TFFeatID) values(?,?)">
              <sql:param value='$(IDnew}'/>
              <sql:param value='${featurenew}'/>
              </sql:update>And got the following error in the localhost.log
    31/07/2006 09:31:41 org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet jsp threw exception
    java.sql.SQLException: SQL Exception : [Microsoft][ODBC Microsoft Access Driver]Optional feature not implemented
         at sun.jdbc.odbc.JdbcOdbcPreparedStatement.setObject(JdbcOdbcPreparedStatement.java:1437)
         at sun.jdbc.odbc.JdbcOdbcPreparedStatement.setObject(JdbcOdbcPreparedStatement.java:1072)
         at sun.jdbc.odbc.JdbcOdbcPreparedStatement.setObject(JdbcOdbcPreparedStatement.java:1063)
         at org.apache.taglibs.standard.tag.common.sql.UpdateTagSupport.setParameters(UpdateTagSupport.java:254)
         at org.apache.taglibs.standard.tag.common.sql.UpdateTagSupport.doEndTag(UpdateTagSupport.java:156)
         at org.apache.jsp.dataUpdated_jsp._jspx_meth_sql_update_1(dataUpdated_jsp.java:975)
         at org.apache.jsp.dataUpdated_jsp._jspx_meth_c_if_0(dataUpdated_jsp.java:879)
         at org.apache.jsp.dataUpdated_jsp._jspx_meth_c_forEach_0(dataUpdated_jsp.java:680)
         at org.apache.jsp.dataUpdated_jsp._jspService(dataUpdated_jsp.java:151)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:833)
         at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:639)
         at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1285)
         at java.lang.Thread.run(Thread.java:595)
    I have also tried the following in the past with no luck
    <fmt:parseNumber value="${ID}" type="number" var="IDnew"/>
    AND......
    <sql:query
       sql="select TFToolID from tblTtoF where TFToolID = ?"
       var="toolresults">
       <sql:param value="${ID}"/>
    </sql:query>
    <c:forEach var="getID" items="${toolresults.rows}">
         <c:set var="theID" value="${getID.TFToolID}"/>
    </c:forEach>
    AND when that didn't work, added this....
    <fmt:parseNumber value="${theID}" var="IDnew"/>

  • Working with excel files in C#, in a web farm

    I am creating a excel file uploader that after the upload, searches for specific columns, saves data to SQL Server, then gets rid of the excel file.
    I will be accepting .xls & xlsx file types.  The internal file structure should be all fairly standard because this is an internal company app.  So for example, the sheet with the data I am searching for may not always be the first in the book,
    but it will always have the same name.
    From the research I have done, it seems I can use the Interop library or OpenXML.  I am leaning towards interop.  Because we are on a web farm, I think it would be best to not save the file, just work with it in memory. Would this be a concern
    if the files are only only around 50kb? I am only expecting 100 uploads a month.
    If it is preferred or required I save the file before pulling the data out, should I save it to the application directory on the web server and expect it to be ok because I am saving/processing/deleting in one request? Or is there a better solution?  I
    thought of saving to our file share but that opens a whole new bucket of worms because of having to send credentials with the file when saving.
    Simon.

    Hi Simon,
    Open XML SDK can only manipulate Office 2007 and above versions. Since your web form accepts Excel 2003 file, it's not a good choice. But if you want to use the PIA(Primary Interop Assembly) to automate the excel files, it's also not recommened. Neither
    of these two options are suitable in your case, you need to use some 3rd-party library to help you, as recommened in this Microsoft KB article.
    http://support.microsoft.com/kb/257757/en-au
    If your business requires the server-side creation of the Office 97,   Office 2000, Office XP, and Office
    2003 binary file formats, third-party   vendors offer components that can help you. Microsoft does not provide any   such components, so you will need to either build a solution yourself or   purchase one from a third-party vendor. Many different
    third-party products   are available. You should investigate each solution to best match the vendor   to your business needs.If you want to build your own solution that edits the   Office 97, Office 2000, Office XP, and Office 2003 binary file
    formats   directly, you can obtain the file format specifications for free under the   terms of the Microsoft Open Specification Promise (OSP). No technical support   is available for the documentation or for the products that you create, but
      documentation is available. For more information, visit the following Web   site:
    http://www.microsoft.com/interop/docs/officebinaryformats.mspx
    As far as I know, NPOI is a good choice for you. You can search and try it. But as it's a 3rd-party library, we don't provide support for it. It also provide ability to process the worksheet in the memory.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • 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 statement will fail if the data value has empty line

    Hi,
    I notice if the insert statement in my .sql file contains data that has new line (enter key), the insert will fail.
    For example:
    insert into mytable (message)
    values ('this is the first line
    this is the second line that will cause insert statement to fail
    so as this third line');
    commit;
    How to overcome this?
    Please advise.
    Thank you.
    Message was edited by:
    bchurn
    Message was edited by:
    bchurn

    It did not return me any error. What is the error you are receiving ??
    SQL> create table mytable (message varchar2(500));
    Table created.
    SQL> insert into mytable (message)
      2  values ('this is the first line
      3  this is the second line that will cause insert statement to fail
      4  so as this third line');
    1 row created.
    SQL> @c:\test.txt
    1 row created.contents of c:\test.txt
    <<
    insert into mytable (message)
    values ('this is the first line
    this is the second line that will cause insert statement to fail
    so as this third line');
    >>

  • Insert 2rows in an excisting excel file

    Hi everybody,
    Sorry if a similar question was asked but I haven't found it.
    My problem is that we got a file where there are some information . And at all end of the month we will run a java application that will give us 2times 10 values that we will save in that excel file. But I can't found an example where I can open the existing file and add this values to the end of the excel-sheet. End of the excel sheet means search the last entry and add it after that.
    I have an example for the moment that will copy the existing file to a new excel file with a different filename but i wanted to make it on the same file.

    java/excel questions dont usually get answered here.
    java doesnt come with a library to interoperate with ms office.
    you can google for "apache poi". perhaps they have a forum.
    if you want a good chuckle look into why the poi library refers
    to excel files as hssf. ;)

Maybe you are looking for

  • How can I get iCal working for me? Is Server the way??? Really need help he

    Hi, I made an earlier post, but nobody wanted to reply Here goes again. New photography business. My wife uses a MacPro tower, I use a MacBook Pro, and we have a spare Powerbook sitting doing nothing. 1. We want to access and edit the same iCal calen

  • Windows Server R2 stop working. Cannot map network drive with my Win 7 client.

    Hi to everyone. I had a problem for quite some time time and even i tried to solved it till now unfortunately seems unreachable. I have a 2008 R2 server which is used as SQL 2005 server. My application program shared from the server. My win 7 client 

  • Problems with screen enlarging so big I can't use touchpad and phone locks up.

    After getting iOS 7, I have had an issue with some sort of technical glitch with my screen on my 4S.  On occasion (today) the screen pops to a huge display and does not allow me to scroll enough to do anything.  I can't enter my password because the

  • ImageIO: ERROR - MetadataLib.dylib not found

    Hi all, I am downloading image from server and displaying in a table view. When the images are downloaded from server and displaying in table i am getting a error message "ImageIO: ERROR - MetadataLib.dylib not found" and the application quits furthe

  • Different versions of logic studio?

    Hi people! It's my first time posting here. I have a question to ask. You see, I bought the logic express just before the logic pro standalone version was released and I feel like I had been sucker punched hard in the guts. I'm looking to upgrade my