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

Similar Messages

  • SQL Insert Into error on import in FDM

    Hi,
    I am struggling to run a FDM Integration script to import data from SQL table to send to HFM. Error on import -
    Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword 'openquery'. Error during data import
    Below is the script:
    strSQL = "insert into " & strWorkTableName & "("
    strSQL = strSQL & "PartitionKey, CatKey, PeriodKey, DataView, CalcAcctType,DataValue, Account,Entity,ICP)"
    strSQL = strSQL & "Select " & RES.PlngLocKey & "," & RES.PlngCatKey & ","
    strSQL = strSQL & Day(RES.PdtePerKey) & "-" & MonthName(Month(RES.PdtePerKey), True) & "-" & Year(RES.PdtePerKey) & ","
    strSQL = strSQL & "YTD,9,Value,Account,Entity,Inter_Company_Entity_HFM"
    strSQL = strSQL & "from openquery(dw_foundation.dbo.FOU_GL_ACTUAL_MTO,"
    strSQL = strSQL & "Select Amount, Account, Entity,Event,Period"

    Hi
    The SAP Tables are on another server, after changing the script i now get the following error:
    [Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword 'from'. Error during data import
    strSQL = "INSERT INTO " & strWorkTableName
    strSQL = strSQL & "(PartitionKey,CatKey,PeriodKey,DataView,CalcAcctType,DataValue,Account,Entity,ICP)"
    strSQL = strSQL & "Select " & RES.PlngLocKey & "," & RES.PlngCatKey & ","
    strSQL = strSQL & " Year,Period,Entity,Account,Inter_Company_Entity_HFM,'YTD',Value, 9, "
    strSQL = strSQL  & " from ODI_WORK_MARS.dbo.TMP_HFM_DATA_EXTRACT_TIN1 "

  • SQLException: Closed Connection, SQL state [null]; error code [17002]

    Hello All,
    I am supporting a Java 5 project on Tomcat. We've used Spring and Stored Procedure in the project.
    Recently we deployed our application in a GoLive environment and have started seeing Timeout errors in log files. After around two days we also have to restart Tomcat as users are no more able to login to access the application.
    Same application runs fine without any timeout issues on another environment.
    The only difference between two environments is that the Go-Live env has a firewall between Tomcat and Database and the other environment hosts both Tomcat and Database on same machine (i.e. no firewall).
    For GoLive env the only port open on firewall for JDBC connection is 1521 and is used in the connection string url for obtaining the connections.
    When there is a Timeout error, the N/w admin guy observed that the JDBC connection was not attempted on 1521 port, but on some random port which is not open on firewall, due to which the Database server logs also do not show entry for this connection attempt as it gets blocked by the firewall.
    I am not sure why a randam port should be used to connect when a specific port is mentioned in the connection url? Also what can be making this port switching?
    Application uses Apache DBCP with Spring to obtain connections.
    Has anyone experienced similar errors?
    Any suggestions/help on this issue is greatly appreciated!
    Many Thanks,
    CD
    ===============================
    Error Log Extract:
    Error while extracting database product name - falling back to empty error codes
    org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is java.sql.SQLException: Closed Connection
    java.sql.SQLException: Closed Connection
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
    at oracle.jdbc.driver.PhysicalConnection.getMetaData(PhysicalConnection.java:1605)
    at org.apache.commons.dbcp.DelegatingConnection.getMetaData(DelegatingConnection.java:247)
    at org.apache.commons.dbcp.DelegatingConnection.getMetaData(DelegatingConnection.java:247)
    at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.getMetaData(PoolingDataSource.java:231)
    at org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:172)
    at org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:207)
    at org.springframework.jdbc.support.SQLErrorCodesFactory.getErrorCodes(SQLErrorCodesFactory.java:187)
    at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.setDataSource(SQLErrorCodeSQLExceptionTranslator.java:126)
    at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.<init>(SQLErrorCodeSQLExceptionTranslator.java:92)
    at org.springframework.jdbc.support.JdbcAccessor.getExceptionTranslator(JdbcAccessor.java:96)
    at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:294)
    at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:348)
    at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:352)
    at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:356)
    at com.o2.morse.dao.impl.sql.UserDaoImpl.batchLoad(UserDaoImpl.java:371)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:287)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
    at $Proxy3.batchLoad(Unknown Source)
    at com.o2.morse.domain.User.doHousekeeping(User.java:667)
    at com.o2.morse.domain.User$$FastClassByCGLIB$$372ff70b.invoke(<generated>)
    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
    at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:705)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
    at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:643)
    at com.o2.morse.domain.User$$EnhancerByCGLIB$$d5ac966a.doHousekeeping(<generated>)
    at com.o2.morse.scheduler.EndOfDay.run(EndOfDay.java:63)
    at com.o2.morse.scheduler.EndOfDay$$FastClassByCGLIB$$3b2d4927.invoke(<generated>)
    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
    at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:705)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
    at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:643)
    at com.o2.morse.scheduler.EndOfDay$$EnhancerByCGLIB$$488a9f86.run(<generated>)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:248)
    at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:165)
    at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:90)
    at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
    Could not close JDBC Connection
    java.sql.SQLException: Already closed.
    at org.apache.commons.dbcp.PoolableConnection.close(PoolableConnection.java:77)
    at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.close(PoolingDataSource.java:180)
    at org.springframework.jdbc.datasource.DataSourceUtils.doReleaseConnection(DataSourceUtils.java:286)
    at org.springframework.jdbc.datasource.DataSourceUtils.releaseConnection(DataSourceUtils.java:247)
    at org.springframework.jdbc.datasource.DataSourceTransactionManager.doCleanupAfterCompletion(DataSourceTransactionManager.java:297)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.cleanupAfterCompletion(AbstractPlatformTransactionManager.java:754)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.processRollback(AbstractPlatformTransactionManager.java:615)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:560)
    at org.springframework.transaction.interceptor.TransactionAspectSupport.doCloseTransactionAfterThrowing(TransactionAspectSupport.java:284)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:100)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
    at $Proxy3.batchLoad(Unknown Source)
    at com.o2.morse.domain.User.doHousekeeping(User.java:667)
    at com.o2.morse.domain.User$$FastClassByCGLIB$$372ff70b.invoke(<generated>)
    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
    at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:705)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
    at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:643)
    at com.o2.morse.domain.User$$EnhancerByCGLIB$$d5ac966a.doHousekeeping(<generated>)
    at com.o2.morse.scheduler.EndOfDay.run(EndOfDay.java:63)
    at com.o2.morse.scheduler.EndOfDay$$FastClassByCGLIB$$3b2d4927.invoke(<generated>)
    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
    at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:705)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
    at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:643)
    at com.o2.morse.scheduler.EndOfDay$$EnhancerByCGLIB$$488a9f86.run(<generated>)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:248)
    at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:165)
    at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:90)
    at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
    Application exception overridden by rollback exception
    org.springframework.jdbc.UncategorizedSQLException: StatementCallback; uncategorized SQLException for SQL [SELECT ID_USER_DETAILS, USERNAME, CREATED_ON, LAST_LOGIN FROM USER_DETAILS  WHERE STATUS = 157 AND SUPERUSER <> 'Y']; SQL state [null]; error code [17002] ; Io exception: Connection timed out; nested exception is java.sql.SQLException: Io exception: Connection timed out
    java.sql.SQLException: Io exception: Connection timed out
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:255)
    at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:820)
    at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1049)
    at oracle.jdbc.driver.T4CStatement.executeMaybeDescribe(T4CStatement.java:845)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1154)
    at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1313)
    at org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:205)
    at org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:205)
    at org.springframework.jdbc.core.JdbcTemplate$1QueryStatementCallback.doInStatement(JdbcTemplate.java:333)
    at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:282)
    at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:348)
    at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:352)
    at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:356)
    at com.o2.morse.dao.impl.sql.UserDaoImpl.batchLoad(UserDaoImpl.java:371)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:287)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
    at $Proxy3.batchLoad(Unknown Source)
    at com.o2.morse.domain.User.doHousekeeping(User.java:667)
    at com.o2.morse.domain.User$$FastClassByCGLIB$$372ff70b.invoke(<generated>)
    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
    at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:705)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
    at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:643)
    at com.o2.morse.domain.User$$EnhancerByCGLIB$$d5ac966a.doHousekeeping(<generated>)
    at com.o2.morse.scheduler.EndOfDay.run(EndOfDay.java:63)
    at com.o2.morse.scheduler.EndOfDay$$FastClassByCGLIB$$3b2d4927.invoke(<generated>)
    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
    at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:705)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
    at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:643)
    at com.o2.morse.scheduler.EndOfDay$$EnhancerByCGLIB$$488a9f86.run(<generated>)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:248)
    at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:165)
    at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:90)
    at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
    Batch Job Failed: org.springframework.transaction.TransactionSystemException: Could not roll back JDBC transaction; nested exception is java.sql.SQLException: Closed Connection

    I am using latest Jrockit 16)5, ojdbc6_g.jar,spring.jar Weblogic 10.3 and Oracle 10G 10.2.4 .. whatever but always get "Closed Connection"
    java.lang.Throwable: Closed Connection
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
    at oracle.jdbc.driver.PhysicalConnection.createStatement(PhysicalConnection.java:750)
    at oracle.jdbc.OracleConnectionWrapper.createStatement(OracleConnectionWrapper.java:183)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:7053)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3902)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2773)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)

  • Wcf-sql insert operation error

    Hi experts,
    i have scenrion like inserting values by using values by using sql adpter.
    this my  store procedure for inserting records, but when processing file got below error :Microsoft.XLANGs.Core.ServiceCreationException : Failed while creating a wcfsql_insert.Orchestration_1 service.
    my procedure :
    alter  PROC POOrder
    (@id INTEGER
    ,@Itemname varchar(50),
    @Price varchar(50),
    @location varchar(50),
    @ContactDetails varchar(50))
    AS
    BEGIN
    --CREATE TABLE PODepartment1
    -- id INTEGER,
    -- Itemname varchar(50),
    -- Price varchar(50),
    -- location varchar(50),
    -- ContactDetails varchar(50)
    INSERT INTO PODepartment1 (id,Itemname,Price,location,ContactDetails) VALUES (@id,@Itemname,@Price,@location,@ContactDetails) 
    END
    exec POOrder 14,'Rdove','towd','HD','UL'
    --select * from dbo.PODepartment1
    --ALTER TABLE PODepartment1
    --DROP COLUMN location
    thanks ,

    my sample sp here:
    alter  PROC POOrder(@id INTEGER
    ,@Itemname varchar(50),
    @Price varchar(50),
    @location varchar(50),
    @ContactDetails varchar(50))
    AS
    BEGIN
    --create    TABLE PODepartment1
    -- id INTEGER,
    -- Itemname varchar(50),
    -- Price varchar(50),
    -- location varchar(50),
    -- ContactDetails varchar(50)
    my sample SOP:
    INSERT INTO PODepartment1 (id,Itemname,Price,location,ContactDetails) VALUES (@id,@Itemname,@Price,@location,@ContactDetails) 
    END
    exec POOrder 14,'RoyalStag','towd','HYD','UL'
    --select * from dbo.PODepartment1
    --ALTER TABLE PODepartment1
    --DROP COLUMN location
    ALTER TABLE PODepartment1
    ADD location varchar(50)
    -------------------->
    sample input file :
    <ns0:PoItem xmlns:ns0="http://wcfsql_insert.PoItem">
      <id>19</id>
      <Itemname>samsung</Itemname>
      <Price>towd</Price>
      <location>rms</location>
      <ContactDetails>kv</ContactDetails>
    </ns0:PoItem>
    thanks

  • RE:ora-28500 when trying to insert into SQL Server table

    Hi all!
    I'm getting this when i attempt to insert into my table test in a SQL Server database. As u can see from the select, the database link seems ok. Any ideas plz. Thnx..
    SQL> select "idAges" from test@try2;
    no rows selected
    SQL> insert into test@try2 ("idAges","nARAges","nAPAges") values(10,'','');
    insert into test@try2 ("idAges","nARAges","nAPAges") values(10,'','')
    ERROR at line 1:
    ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
    [Generic Connectivity Using ODBC][Microsoft][ODBC SQL Server Driver][SQL
    Server]Cannot insert explicit value for identity column in table 'test' when
    IDENTITY_INSERT is set to OFF. (SQL State: 23000; SQL Code: 544)
    ORA-02063: preceding 2 lines from TRY2

    IDENTITY_INSERT on works only for particular session and for one table. It's not global variable.
    The only idea what I have is to create link from MS Sql to Oracle (right now You have oracle ->ms sql)and then before insert You will set identity_insert on and will run insert.

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

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

  • 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

  • ORA-02025 error while insert into emp@custard select ....

    Hello All,
    I want to insert the row in MS Access 2003 database from SQL PLUS. My oracle version is 9.2.0.1. and OS is Windows 2000 server.
    Insert command is:
    SQL> insert into emp@custard select empno, ename, job, mgr, hiredate, sal, comm, deptno from emp ;
    and the error is
    ORA-02025: all tables in the SQL statement must be at the remote database.
    Thanks for helping me.
    Akshay.
    PS: i am able to see the records of Access table in SQL Plus using below command
    select * from acc_tab@custard ;

    Hi,
    I got the solution.
    You can not use directly Insert into remote_table select * from local_table while the other database is not oracle database. The same can be done as:
    SQL> select * from emp@custard ;
    no rows selected
    SQL> copy from scott/tiger@trimcap insert emp@custard using select * from emp ;
    Array fetch/bind size is 15. (arraysize is 15)
    Will commit when done. (copycommit is 0)
    Maximum long size is 80. (long is 80)
    14 rows selected from scott@trimcap.
    14 rows inserted into EMP@CUSTARD.
    14 rows committed into EMP@CUSTARD at DEFAULT HOST connection.
    SQL> select * from emp@custard ;
    EMPNO ENAME JOB MGR HIREDATE SAL COMM
    DEPTNO
    7369 SMITH CLERK 7902 17/DEC/80 800
    20
    7499 ALLEN SALESMAN 7698 20/FEB/81 1600 300
    30
    7521 WARD SALESMAN 7698 22/FEB/81 1250 500
    30
    EMPNO ENAME JOB MGR HIREDATE SAL COMM
    DEPTNO
    7566 JONES MANAGER 7839 02/APR/81 2975
    20
    7654 MARTIN SALESMAN 7698 28/SEP/81 1250 1400
    30
    7698 BLAKE MANAGER 7839 01/MAY/81 2850
    30
    EMPNO ENAME JOB MGR HIREDATE SAL COMM
    DEPTNO
    7782 CLARK MANAGER 7839 09/JUN/81 2450
    10
    7788 SCOTT ANALYST 7566 19/APR/87 3000
    20
    7839 KING PRESIDENT 17/NOV/81 5000
    10
    EMPNO ENAME JOB MGR HIREDATE SAL COMM
    DEPTNO
    7844 TURNER SALESMAN 7698 08/SEP/81 1500 0
    30
    7876 ADAMS CLERK 7788 23/MAY/87 1100
    20
    7900 JAMES CLERK 7698 03/DEC/81 950
    30
    EMPNO ENAME JOB MGR HIREDATE SAL COMM
    DEPTNO
    7902 FORD ANALYST 7566 03/DEC/81 3000
    20
    7934 MILLER CLERK 7782 23/JAN/82 1300
    10
    14 rows selected.
    SQL>
    Hope this helps others... if you stuck like me.
    Thanks & Regards,
    Akshay Brahmbhatt.

  • Error when inserting into a table

    Hi,
    I am running this insert stmt
    SQL> insert into cntct select * from CUSTSRV_ADMN.cntct_bk1;
    ERROR at line 1:
    ORA-01733: virtual column not allowed here
    Below is the table structure.
    SQL> desc cntct;
    Name Null? Type
    CNTCT_KEY NOT NULL NUMBER(10)
    CNTCT_NUM NOT NULL CHAR(12)
    SRC_SYS_DESC NOT NULL VARCHAR2(5)
    ACTVTY_DT NOT NULL DATE
    CNTCT_TYPE_DESC NOT NULL VARCHAR2(15)
    CNTCT_INIATR_CD NOT NULL CHAR(1)
    CNTCT_INIATR_DESC NOT NULL VARCHAR2(10)
    CNTCT_INIATR_NAME NOT NULL VARCHAR2(30)
    CNTCT_INIATR_PHONE_NUM VARCHAR2
    CNTCT_STUS_CD NOT NULL CHAR(1)
    CNTCT_STUS_DESC NOT NULL VARCHAR2(10)
    CNTCT_AGE_DAYS_CNT NOT NULL NUMBER(4)
    CNTCT_ELPSD_TIME_SEC_CNT NOT NULL NUMBER(10)
    CNTCT_RCVD_DT NOT NULL DATE
    CNTCT_OPEN_DT NOT NULL DATE
    CNTCT_RSLTN_DT NOT NULL DATE
    CNTCT_NEW_IND NOT NULL CHAR(1)
    HIGHST_NMIS_CD NOT NULL NUMBER(1)
    INIATNG_AGENT_KEY NOT NULL NUMBER(5)
    CLSNG_AGENT_KEY NOT NULL NUMBER(5)
    CNTCT_ID NOT NULL VARCHAR2(20)
    IMG_NUM NOT NULL VARCHAR2(13)
    PRVDR_NPI NOT NULL VARCHAR2(10)
    PRVDR_TIN NOT NULL VARCHAR2(9)
    CNTCT_OPEN_DTIME NOT NULL DATE
    CNTCT_RSLTN_DTIME NOT NULL DATE
    Please advise.
    Regards,
    Narayan

    No its another table.
    I also tried using columns instead of '*'
    SQL> insert into cntct
    2 select CNTCT_KEY,
    3 CNTCT_NUM,
    4 SRC_SYS_DESC,
    5 ACTVTY_DT,
    6 CNTCT_TYPE_DESC,
    7 CNTCT_INIATR_CD,
    8 CNTCT_INIATR_DESC,
    9 CNTCT_INIATR_NAME,
    10 CNTCT_INIATR_PHONE_NUM,
    11 CNTCT_STUS_CD,
    12 CNTCT_STUS_DESC,
    13 CNTCT_AGE_DAYS_CNT,
    14 CNTCT_ELPSD_TIME_SEC_CNT,
    15 CNTCT_RCVD_DT,
    16 CNTCT_OPEN_DT,
    17 CNTCT_RSLTN_DT,
    18 CNTCT_NEW_IND,
    19 HIGHST_NMIS_CD,
    20 INIATNG_AGENT_KEY,
    21 CLSNG_AGENT_KEY,
    22 CNTCT_ID,
    23 IMG_NUM,
    24 PRVDR_NPI,
    25 PRVDR_TIN,
    26 CNTCT_OPEN_DTIME,
    27 CNTCT_RSLTN_DTIME
    28 from CUSTSRV_ADMN.cntct_bk1;
    Still have the same error.
    insert into cntct
    ERROR at line 1:
    ORA-01733: virtual column not allowed here
    Please advise.
    Regards,
    Narayan

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

  • Error while inserting into ms access using jsp

    i am using the following code to insert values from textboxes into access database
    try
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    con = DriverManager.getConnection(url);
              Statement stmt=con.createStatement();
              //ResultSet rs = null;
              //String sql = ("INSERT INTO co-ords VALUES ('" + nam + "','" + lat + "','" + lon + "','"+ latm +"','"+ lonm +"','"+ latmd +"','"+ lonmd +"','"+ latms +"','"+ lonms +"') ");
              String sql = "INSERT INTO co-ords (nam ,lat , lon , latm ,lonm , latmd , lonmd ,latms , lonms) VALUES ('" + nam + "','" + lat + "','" + lon + "','"+ latm +"','"+ lonm +"','"+ latmd +"','"+ lonmd +"','"+ latms +"','"+ lonms +"') ";
              out.println(sql);
              stmt.executeUpdate(sql);
    the output i get is
    INSERT INTO co-ords (nam ,lat , lon , latm ,lonm , latmd , lonmd ,latms , lonms) VALUES ('cck','28.656529681148545','77.23440170288086','28','77','39','14','23.508','3.8472') Exception:java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.
    can somebody help me?

    Simple,
    Some error in your query right. Unable to understand Quotation stuff.
    Well understand it properly else error will follow forever :)
    Without String, Straight Away Values
    stmt1.executeUpdate("insert into Login_Details values('Example','Exmaple')");This is the query with Login_Id Pass_Word String containing the value
    stmt1.executeUpdate("insert into Login_Details values('"+Login_Id+"','"+Pass_Word+"')");Then storing sql as string and pass it in executeUpdate(sql)
    String sql="insert into Login_Details values ('example','example') "String + Values in String
    String sql="insert into Login_Details values ('"+example+"','"+example+"') "Just first it . Hope this reply solve ur SQL EXCEPTIONG
    Sachin Kokcha

  • Loading datafrom a PL/SQL table into the Database table

    I have created two procedures to try and achieve the problem at hand.
    It retrieves and displays the record from a DBMS_OUTPUT.PUT_LINE prospective as indicated in (1&2), but I am having difficulty loading these values into a PL/SQL table from the package labeled as (3). I read your book and all but I do not see a solution to my problem
    All code compiles. (1&2) work together, (3) works by itself but will not populate the table, and I get no errors.
    1.The first being the one that retrieves the XML file and parses it.
    CREATE OR REPLACE procedure xml_main is
    P XMLPARSER.Parser;
    DOC CLOB;
    v_xmldoc xmldom.DOMDocument;
    v_out CLOB;
    BEGIN
    P := xmlparser.newParser;
    xmlparser.setValidationMode(p, FALSE);
    DOC := '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <com.welligent.Student.BasicStudent.Create>
    <ControlAreaSync messageCategory="com.welligent.Student" messageObject="BasicStudent" messageAction="Create" messageRelease="1.0" messagePriority="1" messageType="Sync">
    <Sender>
    <MessageId>
    <SenderAppId>com.openii.SyncRouter</SenderAppId>
    <ProducerId>a72af712-90ea-43be-b958-077a87a29bfb</ProducerId>
    <MessageSeq>53</MessageSeq>
    </MessageId>
    <Authentication>
    <AuthUserId>Router</AuthUserId>
    </Authentication>
    </Sender>
    <Datetime>
    <Year>2001</Year>
    <Month>3</Month>
    <Day>23</Day>
    <Hour>13</Hour>
    <Minute>47</Minute>
    <Second>30</Second>
    <SubSecond>223</SubSecond>
    <Timezone>6:00-GMT</Timezone>
    </Datetime>
    </ControlAreaSync>
    <DataArea>
    <NewData>
    <BasicStudent mealCode="" usBorn="Yes" migrant="No" workAbility="No" ellStatus="">
    <StudentNumber>052589F201</StudentNumber>
    <ExternalIdNumber>1234567890</ExternalIdNumber>
    <StateIdNumber>123456</StateIdNumber>
    <Name>
    <LastName>Lopez</LastName>
    <FirstName>Maria</FirstName>
    <MiddleName>S</MiddleName>
    </Name>
    <Gender>Female</Gender>
    <BirthDate>
    <Month>1</Month>
    <Day>1</Day>
    <Year>1995</Year>
    </BirthDate>
    <Race>Hispanic</Race>
    <Ethnicity>Hispanic</Ethnicity>
    <PrimaryLanguage>English</PrimaryLanguage>
    <HouseholdLanguage>Spanish</HouseholdLanguage>
    <Address>
    <Street>123 Any Street</Street>
    <ApartmentNumber>12-D</ApartmentNumber>
    <City>Los Angeles</City>
    <County>Los Angeles</County>
    <State>CA</State>
    <ZipCode>90071</ZipCode>
    </Address>
    </BasicStudent>
    </NewData>
    </DataArea>
    </com.welligent.Student.BasicStudent.Create>';
    --v_out := DOC;
    SYS.XMLPARSER.PARSECLOB ( P, DOC );
    v_xmldoc := SYS.XMLPARSER.getDocument(P);
    --DBMS_LOB.createtemporary(v_out,FALSE,DBMS_LOB.SESSION);
    --v_out := SYS.XMLPARSER.PARSECLOB ( P, DOC );
    --SYS.XMLDOM.writetoCLOB(v_xmldoc, v_out);
    --INSERT INTO TEST (TEST_COLUMN)
    --VALUES(V_OUT);
    --printElements(v_xmldoc);
    printElementAttributes(v_xmldoc);
    exception
    when xmldom.INDEX_SIZE_ERR then
    raise_application_error(-20120, 'Index Size error');
    when xmldom.DOMSTRING_SIZE_ERR then
    raise_application_error(-20120, 'String Size error');
    when xmldom.HIERARCHY_REQUEST_ERR then
    raise_application_error(-20120, 'Hierarchy request error');
    when xmldom.WRONG_DOCUMENT_ERR then
    raise_application_error(-20120, 'Wrong doc error');
    when xmldom.INVALID_CHARACTER_ERR then
    raise_application_error(-20120, 'Invalid Char error');
    when xmldom.NO_DATA_ALLOWED_ERR then
    raise_application_error(-20120, 'Nod data allowed error');
    when xmldom.NO_MODIFICATION_ALLOWED_ERR then
    raise_application_error(-20120, 'No mod allowed error');
    when xmldom.NOT_FOUND_ERR then
    raise_application_error(-20120, 'Not found error');
    when xmldom.NOT_SUPPORTED_ERR then
    raise_application_error(-20120, 'Not supported error');
    when xmldom.INUSE_ATTRIBUTE_ERR then
    raise_application_error(-20120, 'In use attr error');
    END;
    2. The second which displays the values from the .xml file I initialized above.
    CREATE OR REPLACE procedure printElementAttributes(doc xmldom.DOMDocument) is
    nl XMLDOM.DOMNODELIST;
    len1 NUMBER;
    len2 NUMBER;
    n XMLDOM.DOMNODE;
    e XMLDOM.DOMELEMENT;
    nnm XMLDOM.DOMNAMEDNODEMAP;
    attrname VARCHAR2(100);
    attrval VARCHAR2(100);
    text_value VARCHAR2(100):=NULL;
    n_child XMLDOM.DOMNODE;
    BEGIN
    -- get all elements
    nl := XMLDOM.getElementsByTagName(doc, '*');
    len1 := XMLDOM.getLength(nl);
    -- loop through elements
    FOR j in 0..len1-1 LOOP
    n := XMLDOM.item(nl, j);
    e := XMLDOM.makeElement(n);
    DBMS_OUTPUT.PUT_LINE(xmldom.getTagName(e) || ':');
    -- get all attributes of element
    nnm := xmldom.getAttributes(n);
    n_child:=xmldom.getFirstChild(n);
    text_value:=xmldom.getNodeValue(n_child);
    dbms_output.put_line('val='||text_value);
    IF (xmldom.isNull(nnm) = FALSE) THEN
    len2 := xmldom.getLength(nnm);
    dbms_output.put_line('length='||len2);
    -- loop through attributes
    FOR i IN 0..len2-1 LOOP
    n := xmldom.item(nnm, i);
    attrname := xmldom.getNodeName(n);
    attrval := xmldom.getNodeValue(n);
    dbms_output.put(' ' || attrname || ' = ' || attrval);
    END LOOP;
    dbms_output.put_line('');
    END IF;
    END LOOP;
    END printElementAttributes;
    3. The package trying to insert into a PL/SQL table.
    CREATE OR REPLACE PACKAGE BODY XMLSTUD2 AS
    PROCEDURE STUDLOAD
    IS
    v_parser xmlparser.Parser;
    v_doc xmldom.DOMDocument;
    v_nl xmldom.DOMNodeList;
    v_n xmldom.DOMNode;
    DOC CLOB;
    v_out CLOB;
    n2 XMLDOM.DOMNODELIST;
    TYPE stuxml_type IS TABLE OF STUDENTS%ROWTYPE;
    s_tab stuxml_type := stuxml_type();
    --l_sturec students%rowtype;
    BEGIN
    -- Create a parser.
    v_parser := xmlparser.newParser;
    xmlparser.setValidationMode(v_parser, FALSE);
    DOC := '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <com.welligent.Student.BasicStudent.Create>
    <ControlAreaSync messageCategory="com.welligent.Student" messageObject="BasicStudent" messageAction="Create" messageRelease="1.0" messagePriority="1" messageType="Sync">
    <Sender>
    <MessageId>
    <SenderAppId>com.openii.SyncRouter</SenderAppId>
    <ProducerId>a72af712-90ea-43be-b958-077a87a29bfb</ProducerId>
    <MessageSeq>53</MessageSeq>
    </MessageId>
    <Authentication>
    <AuthUserId>Router</AuthUserId>
    </Authentication>
    </Sender>
    <Datetime>
    <Year>2001</Year>
    <Month>3</Month>
    <Day>23</Day>
    <Hour>13</Hour>
    <Minute>47</Minute>
    <Second>30</Second>
    <SubSecond>223</SubSecond>
    <Timezone>6:00-GMT</Timezone>
    </Datetime>
    </ControlAreaSync>
    <DataArea>
    <NewData>
    <BasicStudent mealCode="" usBorn="Yes" migrant="No" workAbility="No" ellStatus="">
    <StudentNumber>052589F201</StudentNumber>
    <ExternalIdNumber>1234567890</ExternalIdNumber>
    <StateIdNumber>123456</StateIdNumber>
    <Name>
    <LastName>Lopez</LastName>
    <FirstName>Maria</FirstName>
    <MiddleName>S</MiddleName>
    </Name>
    <Gender>Female</Gender>
    <BirthDate>
    <Month>1</Month>
    <Day>1</Day>
    <Year>1995</Year>
    </BirthDate>
    <Race>Hispanic</Race>
    <Ethnicity>Hispanic</Ethnicity>
    <PrimaryLanguage>English</PrimaryLanguage>
    <HouseholdLanguage>Spanish</HouseholdLanguage>
    <Address>
    <Street>123 Any Street</Street>
    <ApartmentNumber>12-D</ApartmentNumber>
    <City>Los Angeles</City>
    <County>Los Angeles</County>
    <State>CA</State>
    <ZipCode>90071</ZipCode>
    </Address>
    </BasicStudent>
    </NewData>
    </DataArea>
    </com.welligent.Student.BasicStudent.Create>';
    -- Parse the document and create a new DOM document.
    SYS.XMLPARSER.PARSECLOB ( v_parser, DOC );
    v_doc := SYS.XMLPARSER.getDocument(v_parser);
    -- Free resources associated with the Parser now it is no longer needed.
    xmlparser.freeParser(v_parser);
    -- Get a list of all the STUD nodes in the document using the XPATH syntax.
    v_nl := xslprocessor.selectNodes(xmldom.makeNode(v_doc),'/com.welligent.Student.BasicStudent.Create/DataArea/NewData/BasicStudent/Address');
    dbms_output.put_line( 'New Stud processed on '||to_char(sysdate, 'YYYY-MON-DD'));
    -- Loop through the list and create a new record in a tble collection
    -- for each STUD record.
    FOR stud IN 0 .. xmldom.getLength(v_nl) - 1 LOOP
    v_n := xmldom.item(v_nl, stud);
    s_tab.extend;
    -- Use XPATH syntax to assign values to he elements of the collection.
    --s_tab(s_tab.last).STUDENT_ID :=xslprocessor.valueOf(v_n,'StudentNumber');
    --s_tab(s_tab.last).SSN :=xslprocessor.valueOf(v_n,'ExternalIdNumber');
    --s_tab(s_tab.last).SHISID :=xslprocessor.valueOf(v_n,'StateIdNumber');
    s_tab(s_tab.last).STUDENT_LAST_NAME :=xslprocessor.valueOf(v_n,'LastName');
    --dbms_output.put_line( s_tab(s_tab.last).STUDENT_LAST_NAME);
    s_tab(s_tab.last).STUDENT_FIRST_NAME :=xslprocessor.valueOf(v_n,'FirstName');
    --s_tab(s_tab.last).STUDENT_MI :=xslprocessor.valueOf(v_n,'MiddleName');
    --s_tab(s_tab.last).STUDENT_GENDER :=xslprocessor.valueOf(v_n,'Gender');
    --s_tab(s_tab.last).SHISID :=xslprocessor.valueOf(v_n,'Month');
    --s_tab(s_tab.last).SHISID :=xslprocessor.valueOf(v_n,'Day');
    --s_tab(s_tab.last).SHISID :=xslprocessor.valueOf(v_n,'Year');
    --s_tab(s_tab.last).STUDENT_RACE :=xslprocessor.valueOf(v_n,'Race');
    --s_tab(s_tab.last).STUDENT_ETHNIC :=xslprocessor.valueOf(v_n,'Ethnicity');
    --s_tab(s_tab.last).STUDENT_PRI_LANG :=xslprocessor.valueOf(v_n,'PrimaryLanguage');
    --s_tab(s_tab.last).STUDENT_SEC_LANG :=xslprocessor.valueOf(v_n,'HouseholdLanguage');
    --s_tab(s_tab.last).STUDENT_STREET :=xslprocessor.valueOf(v_n,'Street');
    --s_tab(s_tab.last).STUDENT_APART_NO :=xslprocessor.valueOf(v_n,'ApartmentNumber');
    --s_tab(s_tab.last).STUDENT_COUNTY :=xslprocessor.valueOf(v_n,'City');
    --s_tab(s_tab.last).STUDENT_COUNTY :=xslprocessor.valueOf(v_n,'County');
    --s_tab(s_tab.last).STUDENT_STATE :=xslprocessor.valueOf(v_n,'State');
    --s_tab(s_tab.last).STUDENT_ZIP :=xslprocessor.valueOf(v_n,'ZipCode');
    END LOOP;
    FOR stud IN s_tab.first..s_tab.last LOOP
    dbms_output.put_line( s_tab(s_tab.last).STUDENT_LAST_NAME);
    INSERT INTO STUDENTS (
    SHISID, SSN, DOE_SCHOOL_NUMBER,
    PATIENT_TYPE, TEACHER, HOMEROOM,
    STUDENT_LAST_NAME, STUDENT_FIRST_NAME, STUDENT_MI,
    STUDENT_DOB, STUDENT_BIRTH_CERT, STUDENT_COMM,
    STUDENT_MUSA, STUDENT_FAMSIZE, STUDENT_FAMINCOME,
    STUDENT_UNINSURED, STUDENT_LUNCH, STUDENT_ZIP,
    STUDENT_STATE, STUDENT_COUNTY, STUDENT_STREET,
    STUDENT_APART_NO, STUDENT_PHONE, STUDENT_H2O_TYPE,
    STUDENT_WASTE_TRT, STUDENT_HOME_SET, STUDENT_NONHOME_SET,
    STUDENT_GENDER, STUDENT_RACE, STUDENT_ETHNIC,
    STUDENT_PRI_LANG, STUDENT_SEC_LANG, STUDENT_ATRISK,
    EMER_COND_MEMO, ASSIST_DEVICE_TYPE, SCHOOL_ENTER_AGE,
    STUDENT_CURR_GRADE, S504_ELIG_DATE, S504_DEV_DATE,
    S504_REV_DATE, STUDENT_504, STUDENT_IEP,
    IEP_EXP_DATE, GRAD_CLASS, TYPE_DIPLOMA,
    GRADE_RETAIN, LIT_PASS_TEST_MATH, LIT_PASS_DATE_MATH,
    LIT_PASS_TEST_WRITE, LIT_PASS_DATE_WRITE, LIT_PASS_TEST_READ,
    LIT_PASS_DATE_READ, SPEC_ED_ELIG, SPEC_ED_CODE,
    TRANSPORT_CODE, TRANSPORT_NO, PRIME_HANDICAP,
    PRIME_HANDICAP_PERCENT, PRIME_HANDI_MANAGER, FIRST_ADD_HANDI,
    FIRST_ADD_HANDICAP_PERCENT, FIRST_ADD_HANDI_504, FIRST_ADD_HANDI_504_DATE,
    SECOND_ADD_HANDI, SECOND_ADD_HANDICAP_PERCENT, MED_EXTERNAL_NAME,
    INS_TYPE, INS_PRI, INS_NAME,
    INS_MEDICAID_NO, ELIGDATE, INS_PRIV_INSURANCE,
    INS_APPR_BILL, INS_APPR_DATE, INS_PARENT_APPR,
    INS_POL_NAME, INS_POL_NO, INS_CARRIER_NO,
    INS_CARRIER_NAME, INS_CARRIER_RELATE, INS_AFFECT_DATE,
    INS_COPAY_OV, INS_COPAY_RX, INS_COPAY_AMBUL,
    INS_COPAY_EMER, INS_COPAY_OUTPAT, STUDENT_INACTIVE,
    PHYS_ID, ENCOUNTERNUM, USERID,
    MODDATE, STUDENT_ID, S504_DISABILITY,
    CHAPTER1, WELLNESS_ENROLL, SCHOOL_OF_RESIDENCE,
    INITIAL_IEP_DATE, CALENDAR_TRACK, USA_BORN,
    ALT_ID, FUTURE_SCHOOL, IEP_LAST_MEETING,
    IEP_LAST_SETTING, IEP_LAST_REFER_EVAL, THIRD_ADD_HANDI,
    LEP, GIFTED, IEP_EXIT_REASON,
    CASE_MANAGER_ID, INTAKE_NOTES, CALLER_PHONE,
    CALL_DATE, CALLER_RELATIONSHIP, CALLER_NAME,
    BUSINESS_PHONE, FAX, EMAIL,
    HIGHEST_EDUCATION, INTAKE_DATE, SERVICE_COORDINATOR,
    DISCHARGE_DATE, DISCHARGE_REASON, DISCHARGE_NOTES,
    INTAKE_BY, INTAKE_STATUS, IEP_LAST_SERVED_DATE,
    IEP_APC_DATE, IEP_EXIT_DATE, ADDRESS2,
    LEGAL_STATUS, RELIGION, EMPLOYMENT_STATUS,
    TARG_POP_GROUP1, TARG_POP_GROUP2, MARITAL_STATUS,
    THIRD_ADD_HANDI_PERCENT, LAST_INTERFACE_DATE, SERVICE_PLAN_TYPE,
    CURRENT_JURISDICTION, FIPS, BIRTH_PLACE_JURISDICTION,
    BIRTH_PLACE_HOSPITAL, BIRTH_PLACE_STATE, BIRTH_PLACE_COUNTRY,
    OTHER_CLIENT_NAME, SIBLINGS_WITH_SERVICES, PERM_SHARE_INFORMATION,
    PERM_VERIFY_INSURANCE, REFERRING_AGENCY, REFERRING_INDIVIDUAL,
    AUTOMATIC_ELIGIBILITY, INTAKE_IEP_ID, FUTURE_SCHOOL2,
    FUTURE_SCHOOL3, TRANSLATOR_NEEDED, TOTAL_CHILDREN_IN_HOME,
    REFERRED_BY, FAMILY_ID, SCREENING_CONSENT_FLAG,
    PICTURE_FILE, DUAL_ENROLLED, DOE_SCHOOL_NUMBER2)
    VALUES (123456789012, null,null ,
    null,null,null ,s_tab(stud).STUDENT_LAST_NAME
    , s_tab(stud).STUDENT_LAST_NAME,null ,
    null ,null ,null ,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null ,null , null,
    null, null,null );
    END LOOP;
    COMMIT;
    -- Free any resources associated with the document now it
    -- is no longer needed.
    xmldom.freeDocument(v_doc);
    END STUDLOAD;
    END XMLSTUD2;
    /

    Here's a first cut for you. Note that I've added some annotations to the XML Schema
    SQL>
    SQL>
    SQL> var schemaURL varchar2(256)
    SQL> var schemaPath varchar2(256)
    SQL> --
    SQL> begin
      2    :schemaURL := 'http://xmlns.welligent.com/xsd/Student.xsd';
      3    :schemaPath := '/public/Student.xsd';
      4  end;
      5  /
    PL/SQL procedure successfully completed.
    SQL> call dbms_xmlSchema.deleteSchema(:schemaURL,4)
      2  /
    Call completed.
    SQL> declare
      2    res boolean;
      3    xmlSchema xmlType := xmlType(
      4  '<xs:schema xmlns:xdb="http://xmlns.oracle.com/xdb" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      5     <xs:element name="Address" xdb:defaultTable="">
      6             <xs:complexType>
      7                     <xs:sequence>
      8                             <xs:element ref="Street"/>
      9                             <xs:element ref="ApartmentNumber"/>
    10                             <xs:element ref="City"/>
    11                             <xs:element ref="County"/>
    12                             <xs:element ref="State"/>
    13                             <xs:element ref="ZipCode"/>
    14                     </xs:sequence>
    15             </xs:complexType>
    16     </xs:element>
    17     <xs:element name="ApartmentNumber" xdb:defaultTable="">
    18             <xs:simpleType>
    19                     <xs:restriction base="xs:string">
    20                             <xs:enumeration value="12-D"/>
    21                     </xs:restriction>
    22             </xs:simpleType>
    23     </xs:element>
    24     <xs:element name="AuthUserId" xdb:defaultTable="">
    25             <xs:simpleType>
    26                     <xs:restriction base="xs:string">
    27                             <xs:enumeration value="Router"/>
    28                     </xs:restriction>
    29             </xs:simpleType>
    30     </xs:element>
    31     <xs:element name="Authentication" xdb:defaultTable="">
    32             <xs:complexType>
    33                     <xs:sequence>
    34                             <xs:element ref="AuthUserId"/>
    35                     </xs:sequence>
    36             </xs:complexType>
    37     </xs:element>
    38     <xs:element name="BasicStudent" xdb:defaultTable="">
    39             <xs:complexType>
    40                     <xs:sequence>
    41                             <xs:element ref="StudentNumber"/>
    42                             <xs:element ref="ExternalIdNumber"/>
    43                             <xs:element ref="StateIdNumber"/>
    44                             <xs:element ref="Name"/>
    45                             <xs:element ref="Gender"/>
    46                             <xs:element ref="BirthDate"/>
    47                             <xs:element ref="Race"/>
    48                             <xs:element ref="Ethnicity"/>
    49                             <xs:element ref="PrimaryLanguage"/>
    50                             <xs:element ref="HouseholdLanguage"/>
    51                             <xs:element ref="Address"/>
    52                     </xs:sequence>
    53                     <xs:attribute name="mealCode" type="xs:string" use="required"/>
    54                     <xs:attribute name="usBorn" use="required">
    55                             <xs:simpleType>
    56                                     <xs:restriction base="xs:string">
    57                                             <xs:enumeration value="Yes"/>
    58                                     </xs:restriction>
    59                             </xs:simpleType>
    60                     </xs:attribute>
    61                     <xs:attribute name="migrant" use="required">
    62                             <xs:simpleType>
    63                                     <xs:restriction base="xs:string">
    64                                             <xs:enumeration value="No"/>
    65                                     </xs:restriction>
    66                             </xs:simpleType>
    67                     </xs:attribute>
    68                     <xs:attribute name="workAbility" use="required">
    69                             <xs:simpleType>
    70                                     <xs:restriction base="xs:string">
    71                                             <xs:enumeration value="No"/>
    72                                     </xs:restriction>
    73                             </xs:simpleType>
    74                     </xs:attribute>
    75                     <xs:attribute name="ellStatus" type="xs:string" use="required"/>
    76             </xs:complexType>
    77     </xs:element>
    78     <xs:element name="BirthDate" xdb:defaultTable="">
    79             <xs:complexType>
    80                     <xs:sequence>
    81                             <xs:element ref="Month"/>
    82                             <xs:element ref="Day"/>
    83                             <xs:element ref="Year"/>
    84                     </xs:sequence>
    85             </xs:complexType>
    86     </xs:element>
    87     <xs:element name="City" xdb:defaultTable="">
    88             <xs:simpleType>
    89                     <xs:restriction base="xs:string">
    90                             <xs:enumeration value="Los Angeles"/>
    91                     </xs:restriction>
    92             </xs:simpleType>
    93     </xs:element>
    94     <xs:element name="ControlAreaSync" xdb:defaultTable="">
    95             <xs:complexType>
    96                     <xs:sequence>
    97                             <xs:element ref="Sender"/>
    98                             <xs:element ref="Datetime"/>
    99                     </xs:sequence>
    100                     <xs:attribute name="messageCategory" use="required">
    101                             <xs:simpleType>
    102                                     <xs:restriction base="xs:string">
    103                                             <xs:enumeration value="com.welligent.Student"/>
    104                                     </xs:restriction>
    105                             </xs:simpleType>
    106                     </xs:attribute>
    107                     <xs:attribute name="messageObject" use="required">
    108                             <xs:simpleType>
    109                                     <xs:restriction base="xs:string">
    110                                             <xs:enumeration value="BasicStudent"/>
    111                                     </xs:restriction>
    112                             </xs:simpleType>
    113                     </xs:attribute>
    114                     <xs:attribute name="messageAction" use="required">
    115                             <xs:simpleType>
    116                                     <xs:restriction base="xs:string">
    117                                             <xs:enumeration value="Create"/>
    118                                     </xs:restriction>
    119                             </xs:simpleType>
    120                     </xs:attribute>
    121                     <xs:attribute name="messageRelease" use="required">
    122                             <xs:simpleType>
    123                                     <xs:restriction base="xs:decimal">
    124                                             <xs:enumeration value="1.0"/>
    125                                     </xs:restriction>
    126                             </xs:simpleType>
    127                     </xs:attribute>
    128                     <xs:attribute name="messagePriority" use="required">
    129                             <xs:simpleType>
    130                                     <xs:restriction base="xs:byte">
    131                                             <xs:enumeration value="1"/>
    132                                     </xs:restriction>
    133                             </xs:simpleType>
    134                     </xs:attribute>
    135                     <xs:attribute name="messageType" use="required">
    136                             <xs:simpleType>
    137                                     <xs:restriction base="xs:string">
    138                                             <xs:enumeration value="Sync"/>
    139                                     </xs:restriction>
    140                             </xs:simpleType>
    141                     </xs:attribute>
    142             </xs:complexType>
    143     </xs:element>
    144     <xs:element name="County" xdb:defaultTable="">
    145             <xs:simpleType>
    146                     <xs:restriction base="xs:string">
    147                             <xs:enumeration value="Los Angeles"/>
    148                     </xs:restriction>
    149             </xs:simpleType>
    150     </xs:element>
    151     <xs:element name="DataArea" xdb:defaultTable="">
    152             <xs:complexType>
    153                     <xs:sequence>
    154                             <xs:element ref="NewData"/>
    155                     </xs:sequence>
    156             </xs:complexType>
    157     </xs:element>
    158     <xs:element name="Datetime">
    159             <xs:complexType>
    160                     <xs:sequence>
    161                             <xs:element ref="Year"/>
    162                             <xs:element ref="Month"/>
    163                             <xs:element ref="Day"/>
    164                             <xs:element ref="Hour"/>
    165                             <xs:element ref="Minute"/>
    166                             <xs:element ref="Second"/>
    167                             <xs:element ref="SubSecond"/>
    168                             <xs:element ref="Timezone"/>
    169                     </xs:sequence>
    170             </xs:complexType>
    171     </xs:element>
    172     <xs:element name="Day" xdb:defaultTable="">
    173             <xs:simpleType>
    174                     <xs:restriction base="xs:byte">
    175                             <xs:enumeration value="1"/>
    176                             <xs:enumeration value="23"/>
    177                     </xs:restriction>
    178             </xs:simpleType>
    179     </xs:element>
    180     <xs:element name="Ethnicity" xdb:defaultTable="">
    181             <xs:simpleType>
    182                     <xs:restriction base="xs:string">
    183                             <xs:enumeration value="Hispanic"/>
    184                     </xs:restriction>
    185             </xs:simpleType>
    186     </xs:element>
    187     <xs:element name="ExternalIdNumber" xdb:defaultTable="">
    188             <xs:simpleType>
    189                     <xs:restriction base="xs:int">
    190                             <xs:enumeration value="1234567890"/>
    191                     </xs:restriction>
    192             </xs:simpleType>
    193     </xs:element>
    194     <xs:element name="FirstName" xdb:defaultTable="">
    195             <xs:simpleType>
    196                     <xs:restriction base="xs:string">
    197                             <xs:enumeration value="Maria"/>
    198                     </xs:restriction>
    199             </xs:simpleType>
    200     </xs:element>
    201     <xs:element name="Gender" xdb:defaultTable="">
    202             <xs:simpleType>
    203                     <xs:restriction base="xs:string">
    204                             <xs:enumeration value="Female"/>
    205                     </xs:restriction>
    206             </xs:simpleType>
    207     </xs:element>
    208     <xs:element name="Hour" xdb:defaultTable="">
    209             <xs:simpleType>
    210                     <xs:restriction base="xs:byte">
    211                             <xs:enumeration value="13"/>
    212                     </xs:restriction>
    213             </xs:simpleType>
    214     </xs:element>
    215     <xs:element name="HouseholdLanguage" xdb:defaultTable="">
    216             <xs:simpleType>
    217                     <xs:restriction base="xs:string">
    218                             <xs:enumeration value="Spanish"/>
    219                     </xs:restriction>
    220             </xs:simpleType>
    221     </xs:element>
    222     <xs:element name="LastName" xdb:defaultTable="">
    223             <xs:simpleType>
    224                     <xs:restriction base="xs:string">
    225                             <xs:enumeration value="Lopez"/>
    226                     </xs:restriction>
    227             </xs:simpleType>
    228     </xs:element>
    229     <xs:element name="MessageId" xdb:defaultTable="">
    230             <xs:complexType>
    231                     <xs:sequence>
    232                             <xs:element ref="SenderAppId"/>
    233                             <xs:element ref="ProducerId"/>
    234                             <xs:element ref="MessageSeq"/>
    235                     </xs:sequence>
    236             </xs:complexType>
    237     </xs:element>
    238     <xs:element name="MessageSeq" xdb:defaultTable="">
    239             <xs:simpleType>
    240                     <xs:restriction base="xs:byte">
    241                             <xs:enumeration value="53"/>
    242                     </xs:restriction>
    243             </xs:simpleType>
    244     </xs:element>
    245     <xs:element name="MiddleName" xdb:defaultTable="">
    246             <xs:simpleType>
    247                     <xs:restriction base="xs:string">
    248                             <xs:enumeration value="S"/>
    249                     </xs:restriction>
    250             </xs:simpleType>
    251     </xs:element>
    252     <xs:element name="Minute" xdb:defaultTable="">
    253             <xs:simpleType>
    254                     <xs:restriction base="xs:byte">
    255                             <xs:enumeration value="47"/>
    256                     </xs:restriction>
    257             </xs:simpleType>
    258     </xs:element>
    259     <xs:element name="Month" xdb:defaultTable="">
    260             <xs:simpleType>
    261                     <xs:restriction base="xs:byte">
    262                             <xs:enumeration value="1"/>
    263                             <xs:enumeration value="3"/>
    264                     </xs:restriction>
    265             </xs:simpleType>
    266     </xs:element>
    267     <xs:element name="Name" xdb:defaultTable="">
    268             <xs:complexType>
    269                     <xs:sequence>
    270                             <xs:element ref="LastName"/>
    271                             <xs:element ref="FirstName"/>
    272                             <xs:element ref="MiddleName"/>
    273                     </xs:sequence>
    274             </xs:complexType>
    275     </xs:element>
    276     <xs:element name="NewData" xdb:defaultTable="">
    277             <xs:complexType>
    278                     <xs:sequence>
    279                             <xs:element ref="BasicStudent"/>
    280                     </xs:sequence>
    281             </xs:complexType>
    282     </xs:element>
    283     <xs:element name="PrimaryLanguage" xdb:defaultTable="">
    284             <xs:simpleType>
    285                     <xs:restriction base="xs:string">
    286                             <xs:enumeration value="English"/>
    287                     </xs:restriction>
    288             </xs:simpleType>
    289     </xs:element>
    290     <xs:element name="ProducerId" xdb:defaultTable="">
    291             <xs:simpleType>
    292                     <xs:restriction base="xs:string">
    293                             <xs:enumeration value="a72af712-90ea-43be-b958-077a87a29bfb"/>
    294                     </xs:restriction>
    295             </xs:simpleType>
    296     </xs:element>
    297     <xs:element name="Race" xdb:defaultTable="">
    298             <xs:simpleType>
    299                     <xs:restriction base="xs:string">
    300                             <xs:enumeration value="Hispanic"/>
    301                     </xs:restriction>
    302             </xs:simpleType>
    303     </xs:element>
    304     <xs:element name="Second" xdb:defaultTable="">
    305             <xs:simpleType>
    306                     <xs:restriction base="xs:byte">
    307                             <xs:enumeration value="30"/>
    308                     </xs:restriction>
    309             </xs:simpleType>
    310     </xs:element>
    311     <xs:element name="Sender" xdb:defaultTable="">
    312             <xs:complexType>
    313                     <xs:sequence>
    314                             <xs:element ref="MessageId"/>
    315                             <xs:element ref="Authentication"/>
    316                     </xs:sequence>
    317             </xs:complexType>
    318     </xs:element>
    319     <xs:element name="SenderAppId" xdb:defaultTable="">
    320             <xs:simpleType>
    321                     <xs:restriction base="xs:string">
    322                             <xs:enumeration value="com.openii.SyncRouter"/>
    323                     </xs:restriction>
    324             </xs:simpleType>
    325     </xs:element>
    326     <xs:element name="State" xdb:defaultTable="">
    327             <xs:simpleType>
    328                     <xs:restriction base="xs:string">
    329                             <xs:enumeration value="CA"/>
    330                     </xs:restriction>
    331             </xs:simpleType>
    332     </xs:element>
    333     <xs:element name="StateIdNumber" xdb:defaultTable="">
    334             <xs:simpleType>
    335                     <xs:restriction base="xs:int">
    336                             <xs:enumeration value="123456"/>
    337                     </xs:restriction>
    338             </xs:simpleType>
    339     </xs:element>
    340     <xs:element name="Street" xdb:defaultTable="">
    341             <xs:simpleType>
    342                     <xs:restriction base="xs:string">
    343                             <xs:enumeration value="123 Any Street"/>
    344                     </xs:restriction>
    345             </xs:simpleType>
    346     </xs:element>
    347     <xs:element name="StudentNumber" xdb:defaultTable="">
    348             <xs:simpleType>
    349                     <xs:restriction base="xs:hexBinary">
    350                             <xs:enumeration value="052589F201"/>
    351                     </xs:restriction>
    352             </xs:simpleType>
    353     </xs:element>
    354     <xs:element name="SubSecond" xdb:defaultTable="">
    355             <xs:simpleType>
    356                     <xs:restriction base="xs:short">
    357                             <xs:enumeration value="223"/>
    358                     </xs:restriction>
    359             </xs:simpleType>
    360     </xs:element>
    361     <xs:element name="Timezone" xdb:defaultTable="">
    362             <xs:simpleType>
    363                     <xs:restriction base="xs:string">
    364                             <xs:enumeration value="6:00-GMT"/>
    365                     </xs:restriction>
    366             </xs:simpleType>
    367     </xs:element>
    368     <xs:element name="Year" xdb:defaultTable="">
    369             <xs:simpleType>
    370                     <xs:restriction base="xs:short">
    371                             <xs:enumeration value="1995"/>
    372                             <xs:enumeration value="2001"/>
    373                     </xs:restriction>
    374             </xs:simpleType>
    375     </xs:element>
    376     <xs:element name="ZipCode" xdb:defaultTable="">
    377             <xs:simpleType>
    378                     <xs:restriction base="xs:int">
    379                             <xs:enumeration value="90071"/>
    380                     </xs:restriction>
    381             </xs:simpleType>
    382     </xs:element>
    383     <xs:element name="com.welligent.Student.BasicStudent.Create" xdb:defaultTable="STUDENT_TABLE">
    384             <xs:complexType>
    385                     <xs:sequence>
    386                             <xs:element ref="ControlAreaSync"/>
    387                             <xs:element ref="DataArea"/>
    388                     </xs:sequence>
    389             </xs:complexType>
    390     </xs:element>
    391  </xs:schema>');
    392  begin
    393    if (dbms_xdb.existsResource(:schemaPath)) then
    394      dbms_xdb.deleteResource(:schemaPath);
    395    end if;
    396    res := dbms_xdb.createResource(:schemaPath,xmlSchema);
    397  end;
    398  /
    PL/SQL procedure successfully completed.
    SQL> begin
      2    dbms_xmlschema.registerSchema
      3    (
      4      :schemaURL,
      5      xdbURIType(:schemaPath).getClob(),
      6      TRUE,TRUE,FALSE,TRUE
      7    );
      8  end;
      9  /
    PL/SQL procedure successfully completed.
    SQL> insert into STUDENT_TABLE values (xmltype(
      2  '<com.welligent.Student.BasicStudent.Create>
      3     <ControlAreaSync messageCategory="com.welligent.Student" messageObject="BasicStudent" messageAction="Create" messageRelease="1.0" me
    ssagePriority="1" messageType="Sync">
      4             <Sender>
      5                     <MessageId>
      6                             <SenderAppId>com.openii.SyncRouter</SenderAppId>
      7                             <ProducerId>a72af712-90ea-43be-b958-077a87a29bfb</ProducerId>
      8                             <MessageSeq>53</MessageSeq>
      9                     </MessageId>
    10                     <Authentication>
    11                             <AuthUserId>Router</AuthUserId>
    12                     </Authentication>
    13             </Sender>
    14             <Datetime>
    15                     <Year>2001</Year>
    16                     <Month>3</Month>
    17                     <Day>23</Day>
    18                     <Hour>13</Hour>
    19                     <Minute>47</Minute>
    20                     <Second>30</Second>
    21                     <SubSecond>223</SubSecond>
    22                     <Timezone>6:00-GMT</Timezone>
    23             </Datetime>
    24     </ControlAreaSync>
    25     <DataArea>
    26             <NewData>
    27                     <BasicStudent mealCode="" usBorn="Yes" migrant="No" workAbility="No" ellStatus="">
    28                             <StudentNumber>052589F201</StudentNumber>
    29                             <ExternalIdNumber>1234567890</ExternalIdNumber>
    30                             <StateIdNumber>123456</StateIdNumber>
    31                             <Name>
    32                                     <LastName>Lopez</LastName>
    33                                     <FirstName>Maria</FirstName>
    34                                     <MiddleName>S</MiddleName>
    35                             </Name>
    36                             <Gender>Female</Gender>
    37                             <BirthDate>
    38                                     <Month>1</Month>
    39                                     <Day>1</Day>
    40                                     <Year>1995</Year>
    41                             </BirthDate>
    42                             <Race>Hispanic</Race>
    43                             <Ethnicity>Hispanic</Ethnicity>
    44                             <PrimaryLanguage>English</PrimaryLanguage>
    45                             <HouseholdLanguage>Spanish</HouseholdLanguage>
    46                             <Address>
    47                                     <Street>123 Any Street</Street>
    48                                     <ApartmentNumber>12-D</ApartmentNumber>
    49                                     <City>Los Angeles</City>
    50                                     <County>Los Angeles</County>
    51                                     <State>CA</State>
    52                                     <ZipCode>90071</ZipCode>
    53                             </Address>
    54                     </BasicStudent>
    55             </NewData>
    56     </DataArea>
    57  </com.welligent.Student.BasicStudent.Create>'))
    58  /
    1 row created.
    SQL>
    SQL>
    SQL>

  • Syntax error in insert into

    Hi,
    I'm new to coldfusion and was doing a practice survey. I'm
    getting the following error:
    The INSERT INTO statement contains the following unknown
    field name: &apos;recipes&apos;. Make sure you have typed
    the name correctly, and try the operation again.
    The error occurred in (coldfusion form): line 405
    403 :
    (lname,fname,yourID,status,preprog_survey,recipes,activity,tips,stress,other,othertext,we ight_result,lbs_gained,lbs_lost,behaviors,desc_behaviors,most_help,improve_prog)
    404 : values
    405 :
    ('#lname#','#fname#','#yourID#','#status#','#preprog_survey#','#recipes#','#activity#','# tips#','#stress#','#other#','#othertext#','#weight_result#','#lbs_gained#','#lbs_lost#','# behaviors#','#desc_behaviors#','#most_help#','#improve_prog#')
    406 : </cfquery>
    407 :
    SQL Insert into maintaint
    (lname,fname,yourID,status,preprog_survey,recipes,activity,tips,stress,other,othertext,we ight_result,lbs_gained,lbs_lost,behaviors,desc_behaviors,most_help,improve_prog)
    values ('last name','first
    name','444444','member,'No','0','0','1','0','1','no work, all
    play','gained',' too many','','Yes','Dreaming of eating better, but
    not doing it','This survey!','no improvement suggestions'
    VENDORERRORCODE -3502
    SQLSTATE 42000
    Can anyone tell me what this possibly means? I'm sure its
    probably hard to understand without seeing the form. These are the
    types of fields each are:
    lname, fname, yourID = text
    status = radio
    preprog_survey = radio
    recipes, activity,tips, stress, other, = checkboxes
    othertext, = text
    weight_result, = radio
    lbs_gained,lbs_lost, = text
    behaviors, = radio
    desc_behaviors, most_help, improve_prog = text

    Looking at the code you supplied I noticed that for the
    checkboxes values where '0' and '1'.
    SQL Insert into maintaint
    (lname,fname,yourID,status,preprog_survey,recipes,activity,tips,stress,other,othertext,we ight_result,lbs_gained,lbs_lost,behaviors,desc_behaviors,most_help,improve_prog)
    values ('last name','first
    name','444444','member,'No','0','0','1','0','1','no work, all
    play','gained',' too many','','Yes','Dreaming of eating better, but
    not doing it','This survey!','no improvement suggestions'
    You don't need quotes around numeric values, only text.
    Hope that helps you.

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

Maybe you are looking for

  • Do I need to reinstall Lion because my iPhone stopped being recognized by...

    Do I REALLY need to reinstall Lion because my iPhone stopped being recognized by Image Capture, Aperture and iPhoto but still shows up in iTunes? I was on the phone with Apple Support with 5 different Advisors for more than 3 hrs today and we were no

  • Printing notes in Tiger

    The last "I can't print notes from iCal, just headers, which is stupid" post mentioned that they were running Panther. Has there been any fix for Tiger, so that I can print the notes?

  • Where can I define Account assignment category for order settlement rules

    Dear Gurus,     When I used Tcode: CO07 to create a rework order for parent order. But I cann't find the Account assignment category = Ord (Order) in the maintain Settlement rule overview.   Where can I define Account assignment category for order se

  • Caption fonts on photo pages

    An easy (hopefully) question. I'm trying to change the template on some of my photo pages. I create a new page, then copy and paste the photos from my old page to the new page. However, the captions use the fonts from the old template, and I can't fi

  • TableGenerator

    If I'm using a Table Generator to generate primary key values for more than one table, and I am providing no uniqueness constraints, will the values provided for seperate tables re-start at the initial value each time? For instance, let's say I have