Error Running SQL Insert Statement with & in it

Eclipse: 3.5 Galileo on Window Vista
OEPE: 11gR1 11.1.14
I get "invalid character" error when running this query in Eclipse:
INSERT INTO RECIPE (recipeId, name1, name2, recipeCategoryId) VALUES (2, 'Chunky Chicken Egg Rolls', 'No take–out joint can compare!', 1);
I've tried multiple ways trying to escape the & character, but nothing worked. What is the right way of executing SLQ via OEPE plugin that have special characters in them.
FYI, the following worked fine in Oracle 10g iSQL*Plus:
SET DEFINE ~;
INSERT INTO RECIPE (recipeId, name1, name2, recipeCategoryId) VALUES (2, 'Chunky Chicken Egg Rolls', 'No take–out joint can compare!', 1);
Thanks,
Dmitri.

Very interesting case. I tried your insert stmt and got the same error. I finally got it to work by removing the ";" in the end. It looks like the jdbc driver choked up while there is ";" in the middle of the pl/sql statement and ";" in the end. If you remove ";" in the "No take–out joint can compare!" string and leave the ";" in the end, it also works!
I don't quite understand why Oracle JDBC dirver behaves like that. I'll investigate it more and we may need to do some preprocessing on the pl/sql statement before sending it to the driver. At the mean time, just remove the ";" in the end if your string literal contains ";".
Please let me know whether this workaround works for you. Thanks!
Shenxue

Similar Messages

  • RMAN-10006: error running SQL statement: alter session set remote_dependenc

    Backups are failing with following error
    RMAN-00554: initialization of internal recovery manager package failed
    RMAN-12001: could not open channel default
    RMAN-10008: could not create channel context
    RMAN-10002: ORACLE error: ORA-00096: invalid value SIGNATURE for parameter remote_dependencies_mode, must be from among MANUAL, AUTO
    RMAN-10006: error running SQL statement: alter session set remote_dependencies_mode = signature
    Not able to change to signature
    SQL> alter session set remote_dependencies_mode=signature;
    ERROR:
    ORA-00096: invalid value SIGNATURE for parameter remote_dependencies_mode, must
    be from among MANUAL, AUTO
    I dont see MANUAL or AUTO as valid value for this parameter (http://download.oracle.com/docs/cd/B10501_01/server.920/a96536/ch1175.htm#1023124) DB version is 9.2.0
    Parameter type
    String
    Syntax
    REMOTE_DEPENDENCIES_MODE = {TIMESTAMP | SIGNATURE}
    Default value
    TIMESTAMP
    Parameter class
    Dynamic: ALTER SESSION, ALTER SYSTEM
    =======================================
    I believe it could be because of following bug
    "A PRE-PATCHED ORACLE IMAGE CAN BE INSTALLED IN MEMORY "
    Refer: "https://metalink2.oracle.com/metalink/plsql/f?p=130:15:1613505143885559758::::p15_database_id,p15_docid,p15_show_header,p15_show_help,p15_black_frame,p15_font:BUG,4610411,1,1,1,helvetica"
    I appreciate your effort in fixing this issue.
    Edited by: user10610722 on Nov 25, 2008 4:37 PM

    Hi:
    It seems when you are starting RMAN it's executing some commands (one 'ALTER SESSION...'. It's seems to be a batch which has a bad value for SORT_AREA_SIZE. Find it and modify to a proper value as message shows. If you can't find start RMAN by calling directly the executable ($ORACLE_HOME/bin/rman or %ORACLE_HOME%/bin/rman.exe).

  • Error running SQL and EXEC commands in parallel

    Dear Gurus,
    We are applying 3480000 and in process as soon as workers start it come out of adpatch session and give su the following error:
    ************* Start of AD Worker session *************
    AD Worker version: 11.5.0
    AD Worker started at: Sun Sep 02 2007 23:11:01
    APPL_TOP is set to /sgmtemp/prodappl
    Worker process 4 started.
    Checking if all jobs have their actual and symbolic arguments in sync....
    Done.
    Writing jobs to run to restart file.
    Reading jobs from FND_INSTALL_PROCESSES table ...
    Done reading jobs from FND_INSTALL_PROCESSES table ...
    Telling workers to read 'todo' restart file.
    Done.
    Starting phase 0 (A0): first
    There are now 98197 jobs remaining (current phase=A0):
    0 running, 123 ready to run and 98074 waiting.
    Assigned: file adsysapp2.sql on worker 1 for product admin username APPLSYS.
    Assigned: file cssruwq1.sql on worker 2 for product cs username CS.
    Connecting to CSD......Unable to connect.
    AutoPatch error:
    The following ORACLE error:
    ORA-01017: invalid username/password; logon denied
    occurred while executing the SQL statement:
    CONNECT CSD/*****
    AutoPatch error:
    Error while evaluating "Check Object"
    Telling workers to quit...
    3 workers have quit. Waiting for 1 more.
    All workers have quit.
    Error running SQL and EXEC commands in parallel
    You should check the file
    /sgmtemp/prodappl/admin/msbep004/log/3480000_sbm3.log
    for errors.
    applmgr@21:/sgmtemp/Oglupgr/3480000>
    What could be the issue, i tried to connect CSD/CSD in sql and it connected.
    Thanks in Advance
    Regards
    Kiran Rana

    Hi Gurus,
    Even i tried to recreate the FND_GLOBAL by performing the following, but still no luck:
    output for scripts hearder value in FND_TOP:
    applmgr@21:/sgmtemp/prodcomn/temp> cd $FND_TOP/patch/115/sql
    applmgr@21:/sgmtemp/prodappl/fnd/11.5.0/patch/115/sql> grep Header AFSCGBL*
    AFSCGBLB.pls:/* $Header: AFSCGBLB.pls 115.78 2005/03/21 11:40:02 vbalakri ship $ */
    AFSCGBLS.pls:/* $Header: AFSCGBLS.pls 115.33 2004/06/30 05:00:18 rsheh ship $ */
    Output for script header value in Database:
    SQL> select text from dba_source where name='FND_GLOBAL' and line <5;
    TEXT
    package FND_GLOBAL as
    /* $Header: AFSCGBLS.pls 115.33 2004/06/30 05:00:18 rsheh ship $ */
    package body FND_GLOBAL as
    /* $Header: AFSCGBLB.pls 115.78 2005/03/21 11:40:02 vbalakri ship $ */
    8 rows selected.
    We tried to re-apply 4 hours back when one of the support personnal ask use to run those
    scripts. one of them went with out any errors but second one went with errors
    as follows:
    First Script @AFSCGBLS.pls
    applmgr@21:/sgmtemp/prodappl/fnd/11.5.0/patch/115/sql> sapps @AFSCGBLS.pls
    SQL*Plus: Release 8.0.6.0.0 - Production on Mon Sep 3 03:24:10 2007
    (c) Copyright 1999 Oracle Corporation. All rights reserved.
    Connected to:
    Oracle9i Enterprise Edition Release 9.2.0.7.0 - 64bit Production
    With the Partitioning and Oracle Data Mining options
    JServer Release 9.2.0.7.0 - Production
    DOC> | Copyright (c) 1993 Oracle Corporation Redwood Shores, California, USA|
    DOC> | All rights reserved. |
    DOC> +=======================================================================+
    DOC> | FILENAME
    DOC> | AFSCGBLS.pls
    DOC> |
    DOC> | DESCRIPTION
    DOC> | PL/SQL specification for package: FND_GLOBAL
    DOC> |
    DOC> | NOTES
    DOC> | This module is called by AutoInstall (afplss.drv) on install and
    DOC> | upgrade. The WHENEVER SQLERROR and EXIT (at bottom) are required.
    DOC> |
    DOC> | HISTORY
    DOC> | June, 1999 - Added function AUDIT_ACTIVE, bug 879630. Jan Smith.
    DOC> | 11/19/01 MSkees - Added DBDrv line and 'SET VERIFY OFF' for ARU auto
    DOC> | generation bug 2047263 build
    DOC> |
    DOC> *=======================================================================*/
    Package created.
    Commit complete.
    Disconnected from Oracle9i Enterprise Edition Release 9.2.0.7.0 - 64bit Production
    With the Partitioning and Oracle Data Mining options
    JServer Release 9.2.0.7.0 - Production
    Second Script AFSCGBLB.pls:
    applmgr@21:/sgmtemp/prodappl/fnd/11.5.0/patch/115/sql> sapps @AFSCGBLB.pls <
    SQL*Plus: Release 8.0.6.0.0 - Production on Mon Sep 3 03:27:15 2007
    (c) Copyright 1999 Oracle Corporation. All rights reserved.
    Connected to:
    Oracle9i Enterprise Edition Release 9.2.0.7.0 - 64bit Production
    With the Partitioning and Oracle Data Mining options
    JServer Release 9.2.0.7.0 - Production
    Warning: Package Body created with compilation errors.
    Commit complete.
    Disconnected from Oracle9i Enterprise Edition Release 9.2.0.7.0 - 64bit Production
    With the Partitioning and Oracle Data Mining options
    JServer Release 9.2.0.7.0 -
    Production
    applmgr@21:/sgmtemp/prodappl/fnd/11.5.0/patch/115/sql>
    The second script (AFSCGBLB.pls) run's out with errors and changes status of almost 15000 objects as INVALID in database.
    Regards
    Kiran Rana

  • Where is the syntax error in my Insert statement?

    It says that there is a syntax error in my insert statement, pointing to the .ExecuteNonQuery() at the end:
    'Defining the activity ID from the datatable
    Dim ActivityID As Integer = DataTableActivities.Rows(0).Item(0)
    'Defining the calories from the datatable
    Dim calories As Decimal = (DataTableActivities.Rows(0).Item(3)) * (DurationNum.Value / 60)
    'Insert statement to add new training events
    Dim SqlQueryActivityInsert As String = "INSERT INTO tblTraining (RunnerID, ActivityID, Full_Name, Time, Calories_Burnt, Date) VALUES (@RunnerID, @ActivityID, @Full_Name, @Time, @Calories, @Date)"
    Dim SqlCommandActivity As New OleDbCommand
    With SqlCommandActivity
    .CommandText = SqlQueryActivityInsert
    .Parameters.AddWithValue("@RunnerID", LoginForm.UserIDlbl.Text)
    .Parameters.AddWithValue("@ActivityID", ActivityID)
    .Parameters.AddWithValue("@Full_Name", LoginForm.Full_Namelbl.Text)
    .Parameters.AddWithValue("@Time", DurationNum.Value)
    .Parameters.AddWithValue("@Calories", calories)
    .Parameters.AddWithValue("@Date", WeekPicker.Value)
    .Connection = conn
    .ExecuteNonQuery()

    Viorel is right.  The 'Date' field is probably throwing it off.  Date is a reserved word. 
    https://www.drupal.org/node/141051
    Putting square brackets [] around the field name should get it working for you.
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

  • How to resolve ORA-00001 Error in SQL Insert?

    Hi all, I need your appreciated help.
    I make a plsql procedure that is inserting a row according cursor value, I'm having oracle error ORA-00001: unique constraint (constraint_name) violated.
    You may see this message if a duplicate entry exists at a different level: in RDBMS MySQL I have the syntax IGNORE to resolve this duplication error... and in Oracle ?
    Thanks for your time and hints.
    Miguelito

    user6317803 wrote:
    How to resolve ORA-00001 Error in SQL Insert?ORA-00001 means table has unique/primary key/index and you are trying to insert a row with key value that already exists in the table. I'll assume table COUNTRIES has primary key on COUNTRY_ID. Then change SQL to:
    SQL = "INSERT INTO COUNTRIES(COUNTRY_ID,COUNTRY_NAME,REGION_ID) SELECT 'BZ','BLZ',3 FROM DUAL WHERE NOT EXISTS(SELECT 1 FROM COUNTRIES WHERE COUNTRY_ID = 'BZ')"There is a good chance table COUNTRIES also has unique key/index on COUNTRY_NAME. If so use:
    SQL = "INSERT INTO COUNTRIES(COUNTRY_ID,COUNTRY_NAME,REGION_ID) SELECT 'BZ','BLZ',3 FROM DUAL WHERE NOT EXISTS(SELECT 1 FROM COUNTRIES WHERE COUNTRY_ID = 'BZ' OR COUNTRY_NAME = 'BLZ')"SY.

  • INSERT statement with JSP

              Does anyone know how to create an INSERT statement with JSP using
              variables??
              I can do the insert if I code the values of the variables in the statement,
              but when I try to use variables to do the insert it tries to insert the
              variable name and not the value of the variable into the table.
              Thanks,
              Doug
              

    "Doug Schaible" <[email protected]> wrote in message news:<bicO7.1279268$[email protected]>...
              > I can do the insert if I code the values of the variables in the statement,
              > but when I try to use variables to do the insert it tries to insert the
              > variable name and not the value of the variable into the table.
              Doug,
              I think you missed the <%= blahblah %> syntax.
              Regards
              drit
              

  • While adding/Changing member in planning it gives the error "The SQL operation failed with an error code: 0"

    Hi,<BR>While adding/Changing member in planning it gives the error "The SQL operation failed with an error code: 0" and not allowing any of the changes. I am not able to open the forms giving the error as "Fiscal Days Input - is invalid". Interestingly one form was opening, when the Page selection is changed it also started giving error as like "Fisacal Days Input(form name) - is invalid check log for details". <BR>Pls advice us that what is this error and how to resolve this.<BR><BR>And Which log is to be referred for the details.<BR><BR>Thanks<BR>Ravi

    If a form is invalid it generally means that one of the dimension references is missing.<BR><BR>Can you get in to edit the form?<BR>If you can, see if you can preview it. I suspect you will not be able to.<BR><BR>If not, check all dimension boxes have at least one member against them.<BR>If you have multiple rows and/or columns check all of them too.<BR><BR>I've had a couple of forms in dev "drop" a dimension reference but only once or twice so not enough to reproduce or find out what is causing it. Each time I got the "form invalid" error message and managed to fix it.<BR><BR>Hope this helps.<BR>

  • 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

  • Adpatch: Error running SQL and EXEC commands in parallel

    Hi
    I am applying R12 RUP2 to an instance at the moment. I had an OS crash (I'm running R12 on Linux on VMWARE) and on reboot attempted to restart the patch.
    I now get an error as follows:
    Error running SQL and EXEC commands in parallel
    I must admit, I'm not a DBA, so if anyone has any ideas or has seen this before then it would be most appreciated!
    Thanks
    Chris

    Hi Adith
    The patch is 5484000, RUP 2 for E-Business Suite R12
    Here's the adpatch output:
    Start date: Wed Sep 12 2007 15:15:14
    0 "left over" javaupdates.txt files uploaded to DB: Wed Sep 12 2007 15:15:14
    0 patches uploaded from the ADPSV format patch history files: Wed Sep 12 2007 15:15:14
    Uploading information about files copied during the previous runs ...
    0 "left over" filescopied_<session_id>.txt files uploaded to DB: Wed Sep 12 2007 15:15:14
    ****************** E N D O F U P L O A D ******************
    End date: Wed Sep 12 2007 15:15:14
    Already asked for the name of the patch directory.
    (The answer was: /oracle/patches/5484000)
    Already asked for the name of the patch driver file.
    (The answer was: /oracle/patches/5484000/u5484000.drv)
    Reading release list save file...
    Done reading release list save file
    Log and Info File sync point:
    Wed Sep 12 2007 15:15:15
    Turning off actions that reference unrecognized products.
    Log and Info File sync point:
    Wed Sep 12 2007 15:15:15
    End of unrecognized products checking.
    (The number of parallel workers is: " 2 ")
    AutoPatch will run in parallel mode.
    Did not need to apply new applterr.txt.
    Skipping...
    Determine directories to create for Specified driver
    since no such action is present for this driver file
    Skipping...
    Determine Oracle Reports libraries to generate for Specified driver
    since no such action is present for this driver file
    Skipping...
    Determine if need to generate message files for Specified driver
    since no such action is present for this driver file
    Skipping...
    Create Directories for Specified driver
    since no such action is present for this driver file
    Number of invalid objects: 31057
    Running SQL scripts and EXEC commands...
    Determining which SQL and EXEC commands to run...
    Validating PL/SQL direct execute exceptions file ...
    Done validating PL/SQL direct execute exceptions file.
    SERVICE_NAME/INSTANCE_NAME : [VIS]
    connect_string : [(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ebusr12.chriseebee.me.uk)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=VIS)))]
    Done determining which SQL and EXEC commands to run.
    Running SQL and EXEC commands in parallel...
    Creating the AD_UTIL_PARAMS table...
    Table AD_UTIL_PARAMS already exists, so dropping the table and recreating it.
    Creating FND_INSTALL_PROCESSES table...
    Already created fnd_install_processes table
    Already created FND_INSTALL_PROCESSES_U1 index.
    Already created AD_DEFERRED_JOBS table
    Already created AD_DEFERRED_JOBS_U1 index.
    Writing dependencies of jobs to run to appldep.txt file...
    There are now 7569 jobs remaining (current phase=A0):
    0 running, 5 ready to run and 7564 waiting.
    Reading completed jobs from restart file (if any).
    There are now 3474 jobs remaining (current phase=A18):
    0 running, 1 ready to run and 3473 waiting.
    Determining which java executables are supported by adJavaWorker...
    Starting worker processes.
    Worker process 1 started.
    Worker process 2 started.
    Checking if all jobs have their actual and symbolic arguments in sync....
    Done.
    Writing jobs to run to restart file.
    Reading jobs from FND_INSTALL_PROCESSES table ...
    Running: file adobjcmp.sql on worker 1 for product ad username APPLSYS.
    AutoPatch error:
    The worker should not have status 'Running' or 'Restarted' at this point.
    Telling workers to quit...
    ************* Start of AD Worker session *************
    AD Worker version: 12.0.0
    AD Worker started at: Wed Sep 12 2007 15:15:34
    APPL_TOP is set to /oracle/VIS/apps/apps_st/appl
    ************* Start of AD Worker session *************
    AD Worker version: 12.0.0
    AD Worker started at: Wed Sep 12 2007 15:15:34
    APPL_TOP is set to /oracle/VIS/apps/apps_st/appl
    All workers have quit.
    AutoPatch error:
    Error running SQL and EXEC commands in parallel
    You should check the file
    /oracle/VIS/apps/apps_st/appl/admin/VIS/log/adpatch.log
    for errors.

  • Error running SQL and EXEC commands in parallel when adpatch

    Hi,
    AutoPatch error:
    aiprfp: product 'cle' not in release 'R120'
    AutoPatch error:
    Error running SQL and EXEC commands in parallel
    Freeing includes hash table
    Freeing fixes hash table
    Freeing basedons hash table
    Freeing entities hash table
    You should check the file
    /a02/prod/apps/apps_st/appl/admin/PROD/log/adpatch_7305220_1.log
    for errors.
    How to resolve this errror while applying patch 7305220.
    Regards,

    Hi,
    Please check logfile */a02/prod/apps/apps_st/appl/admin/PROD/log/adpatch_7305220_1.log* for any errors recoded.
    Post error messages from this logfile.This is the main patch log file and it should show the same error "aiprfp: product 'cle' not in release 'R120'".
    Thanks,
    Hussein

  • 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"/>

  • 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

  • ABAP connect SQL run SQL insert into Error

    Dear All
             I have a problem in ABAP connect SQL,Below is my code snippet sentence.
    CONCATENATE 'Insert Into [timportcortrol]'
                    '(zucode,zstate,zdate,zkind) Values('''
                      VG_PCID ''','''
                      '1'','''
                      SY-DATUM ''','''
                      '1' ''')'
                     INTO SQL.
        CALL METHOD OF REC 'Execute'
         EXPORTING #1 = SQL
         #2 = CON
         #3 = '1'.
    IF NOT SY-SUBRC = 0.
        MESSAGE I000 WITH 'Download  to [timportcortrol] failure,Please Check the SQL Connect!!! '.
        EXIT.
      ENDIF.
    "Con:is the connect SQL String ,the connect SQL is Okay.
    I debug this code,when I used u2018Select u2026sentenceu2019,the program can work.if I  use u2018insert intou2019 then canu2019t work,but I copied the SQL of the u2018inset Into sentenceu2026u2019run it into SQL server then it can work also.
    And I found the SY-SUBRC eq u20182u2019.whatu2019s mean about of the sy-subrc eq u20182u2019.
    I think the insert into sentence in abap I have write the wrong ,but I canu2019t assurance.
    The Insert Into Sentence is:u2019 Insert Into [timportcortrol](zucode,zstate,zdate,zkind) Values('20080807094713','1','20080807','1')u2019
    Could you give me some advice for this issue?
    Thanks of all
    Sun.

    Hi
    I think the problem is with the date format "20080807094713". You should know first how the date is stored in the underlying database. In that format we have to pass the date in the SQL DML statements.
    Try "07-Aug-2008' for example and check.
    Hope it helps.
    Murthy

  • Creating Multiple INSERT statements with SQL

    is there a way to create multiple INSERT staements with SQL .
    Example scenario : This is only example but i have lot of data in the real time.
    sql : Select Emplid from Table A where Emplid between 100 and 350 will retun me 50 rows . i want to insert those rows into another table.
    I am looking for output like below instead of Giving output just as EMPLIDs
    Insert into PS_LM_DATA ( EMPLID ) values ( 123 )
    Insert into PS_LM_DATA ( EMPLID ) values ( 234 )
    Insert into PS_LM_DATA ( EMPLID ) values ( 334 )
    and so on....
    thanks ,
    Karu

    If you are inserting into another table, you could use
    insert into PS_LM_DATA ( EMPLID ) 
    select Emplid from Table A where Emplid between 100 and 350Example:
    SQL> insert into emp2(empno) select empno from emp;
    14 rows created.
    SQL> insert into emp2(empno) select empno from emp where empno between 7369 and 7788;
    8 rows created.

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

Maybe you are looking for