Single Apostrophe in Where Statement Causing Error

I am running SQL syntax from MS Access VBA modules. These all work great except for recently I ran into a snag. There is drop-down where the user selects a category and the filter is based off that. All this works fine until they select a category that has
an apostrophe e.g. O'Reillys. Below is the syntax that I have
strWhere ="Category IN ('" & Me.cboCategory & "')"
strSQL = "Select MyTable.* From MyTable Where " & strWhere
The problem rests with the strWhere statement. As I said, it works fine if there is not an apostrophe in the name but if there is then it does not work. Could someone assist me with the syntax I would need. Thanks.
P.S. An ID field is not an option in this case.

Thanks for the response but how would I do that with a variable? I can see how to do it when the value is already known, so with the example I gave, e.g. 
strWhere="Category
IN ('" &
Me.cboCategory
How would the quotes be set with that?

Similar Messages

  • SELECT statement causing error

    Hi all, a particular errors keeps on popping up when i try to activate my program. Error message is as follows:
    The field "C~NAME1" from the SELECT list is missing in the GROUP BY clause. addition INTO wa or into (g1,...,gn) is required. fields of type "" or "A~MANDT".
    Any ideas on what this syntax error message means?
    Look at the SELECT statement that is causing the error:
      SELECT A~MATNR A~WERKS MAX( A~EBELN ) MAX( A~EBELP ) A~BUKRS A~MENGE A~NETPR A~PEINH B~LIFNR B~BEDAT C~NAME1
        INTO (WTAB-MATNR, WTAB-WERKS, WTAB-EBELN, WTAB-EBELP, WTAB-BUKRS, WTAB-MENGE, WTAB-NETPR, WTAB-PEINH, WTAB-LIFNR,WTAB-BEDAT, WTAB-NAME1)
        FROM EKPO AS A
          INNER JOIN EKKO AS B
            ON A~EBELN = B~EBELN AND
               A~BUKRS = B~BUKRS
          INNER JOIN LFA1 AS C
            ON B~LIFNR = C~LIFNR
    *    FOR ALL ENTRIES IN ITAB
        WHERE A~WERKS = I_WERKS AND
              A~BUKRS = I_BUKRS AND
              B~BSTYP = 'F' AND
              B~SPRAS = 'EN'.

    I've got another thing to ask. Ask you all know, i am suppose to complete (or ammend) the program that i am doing now. Look at parts of the original coding that i have yet to make changes to, i would like to know what is it suppose to do and output. Perhaps you guys could explain it better than my consultant:
    TYPES: BEGIN OF TYP_MATTXT,
             MATNR LIKE MARA-MATNR,  "Material Number
             CTRT TYPE I,
             MAT_TXT(80) TYPE C,
             PO_TXT(80) TYPE C,
           END OF TYP_MATTXT.
    DATA: MATTXT TYPE TYP_MATTXT OCCURS 0 WITH HEADER LINE.
    DATA: WA_STXH TYPE STXH,
          TXT LIKE TLINE OCCURS 0 WITH HEADER LINE,
          TXT_KEY LIKE STXH-TDNAME.  "Name
    *&    FORM SELECT_DATA                                                 *
    FORM SELECT_DATA.
      SELECT A~MATNR A~MATKL B~MAKTX A~MTART A~EXTWG C~WERKS
        INTO CORRESPONDING FIELDS OF TABLE ITAB
        FROM MARA AS A
          INNER JOIN MAKT AS B
            ON A~MATNR = B~MATNR AND
               B~SPRAS = 'EN'
          INNER JOIN MARD AS C
            ON A~MATNR = C~MATNR
        WHERE A~MATNR IN I_MATNR AND
              A~MATKL IN I_MATKL AND
              A~MTART IN I_MTART AND
              A~EXTWG IN I_EXTWG AND
              C~WERKS = I_WERKS.
      SORT ITAB BY MATNR MATKL MTART EXTWG WERKS MAKTX.
      CHECK NOT ITAB[] IS INITIAL.
      SELECT A~MATNR A~MATKL A~WERKS MAX( A~EBELN ) MAX( A~EBELP ) A~BUKRS
    A~MENGE A~NETPR A~PEINH A~MTART B~LIFNR B~BEDAT C~NAME1
      INTO TABLE WTAB
    *    INTO (WTAB-MATNR, WTAB-WERKS, WTAB-EBELN, WTAB-EBELP, WTAB-BUKRS,
    *WTAB-MENGE, WTAB-NETPR, WTAB-PEINH, WTAB-LIFNR,WTAB-BEDAT, WTAB-NAME1)
        FROM EKPO AS A
          INNER JOIN EKKO AS B
            ON A~EBELN = B~EBELN AND
               A~BUKRS = B~BUKRS AND
               B~BSTYP = 'F'
          INNER JOIN LFA1 AS C
            ON B~LIFNR = C~LIFNR
        WHERE A~MATNR IN I_MATNR AND
              A~MATKL IN I_MATKL AND
              A~WERKS = I_WERKS AND
              A~BUKRS = I_BUKRS AND
              A~MTART IN I_MTART AND
              A~LOEKZ = ' '
        GROUP BY A~MATNR A~MATKL A~WERKS A~EBELN A~EBELP A~BUKRS A~MENGE
    A~NETPR A~PEINH A~MTART B~LIFNR B~BEDAT C~NAME1.
      SORT WTAB BY MATNR MATKL MTART WERKS EBELN EBELP MENGE NETPR PEINH
    LIFNR BEDAT NAME1.
      LOOP AT WTAB.
        MOVE: WTAB-EBELN TO ITAB-EBELN,
              WTAB-EBELP TO ITAB-EBELP,
              WTAB-BUKRS TO ITAB-BUKRS,
              WTAB-MENGE TO ITAB-MENGE,
              WTAB-NETPR TO ITAB-NETPR,
              WTAB-PEINH TO ITAB-PEINH,
    *          WTAB-MTART TO ITAB-MTART,
              WTAB-LIFNR TO ITAB-LIFNR,
              WTAB-BEDAT TO ITAB-BEDAT,
              WTAB-NAME1 TO ITAB-NAME1.
       MOVE ITAB-MATNR TO TXT_KEY.
       PERFORM READ_TXT USING 'BEST' TXT_KEY 'MATERIAL'.
       CONCATENATE ITAB-EBELN ITAB-EBELP INTO TXT_KEY.
       PERFORM READ_TXT USING 'F01' TXT_KEY 'EKPO'.
        MODIFY ITAB TRANSPORTING EBELN EBELP BUKRS MENGE NETPR PEINH LIFNR
    BEDAT NAME1
          WHERE MATNR = WTAB-MATNR.
      ENDLOOP.
      SORT ITAB BY MATNR MATKL MTART.
      DELETE ADJACENT DUPLICATES FROM ITAB COMPARING ALL FIELDS.
      LINE_CHECK = 0.
    ENDFORM.
    *&    FORM READ_TXT                                                    *
    FORM READ_TXT USING ID XNAME OBJ.
    DATA: CTR TYPE I,
          PO_CTR TYPE I.
    CLEAR: TXT.
      SELECT SINGLE * FROM STXH CLIENT SPECIFIED
      INTO WA_STXH
      WHERE MANDT = SY-MANDT AND
            TDOBJECT = OBJ AND
            TDNAME = XNAME AND
            TDID = ID AND
            TDSPRAS  = SY-LANGU.
      IF SY-SUBRC = 0.
        REFRESH TXT.
        CTR = 1.
        CALL FUNCTION 'READ_TEXT'
             EXPORTING
                  CLIENT   = SY-MANDT
                  ID       = ID
                  NAME     = XNAME
                  OBJECT   = OBJ
                  LANGUAGE = SY-LANGU
             TABLES
                  LINES    = TXT.
        LOOP AT TXT.
          IF ID = 'BEST'.
            MOVE XNAME TO MATTXT-MATNR.
            MOVE CTR TO MATTXT-CTRT.
            MOVE TXT-TDLINE TO MATTXT-MAT_TXT.
            APPEND MATTXT.
          ELSEIF ID = 'F01'.
            READ TABLE MATTXT WITH KEY MATNR = ITAB-MATNR CTRT = CTR.
            IF SY-SUBRC = 0.
              MOVE TXT-TDLINE TO MATTXT-PO_TXT.
              MODIFY MATTXT TRANSPORTING PO_TXT
              WHERE MATNR = ITAB-MATNR.
            ELSE.
              MOVE ITAB-MATNR TO MATTXT-MATNR.
              MOVE CTR TO MATTXT-CTRT.
              MOVE TXT-TDLINE TO MATTXT-PO_TXT.
              APPEND MATTXT.
            ENDIF.
          ENDIF.
          CTR = CTR + 1.
        ENDLOOP.
      ENDIF.
    ENDFORM.

  • Writing single query with conflicting WHERE statements

    How do I run the following as a single query that will result in a column that pertains to the first block of code and then another column that pertains to the 2nd block of code? The issue is that I need 2 different WHERE statements. So the final output will be patient_id, complete, incomplete.
    SELECT patient_id, COUNT(*) AS complete
    FROM STATUS
    WHERE status = 1
    GROUP BY patient_id
    ORDER BY patient_id;
    SELECT patient_id, COUNT(*) AS incomplete
    FROM STATUS
    WHERE status = 2
    GROUP BY patient_id
    ORDER BY patient_id;
    Thanks!

    Hi,
    apex wrote:
    Thanks for all of the help.
    I would like to add another column with decile and am struggling as to how to do it. Since I can't reference something in a calculation in the same step, I think I will need a 3rd nesting, but what I haven't figured out is how to get the number of subjects whose ratio is less than that subject's ratio. Right: you can't assign an alias (such as complete or ratio) to a calculated column and use that alias in the same sub-query.
    If the calculation isn't very complicated, then you might find it simpler just to repeat the calculation. For example, I think this is what you want:
    WITH     got_complete     AS
         SELECT    patient_id
         ,        COUNT ( CASE WHEN status = 1 THEN 1 END )     AS complete
         ,       COUNT ( CASE WHEN status = 2 THEN 1 END )      AS incomplete
         FROM        pt_status
         WHERE        status IN (1,2)
         GROUP BY  patient_id
    SELECT       patient_id, complete, incomplete
    ,                                complete / (complete + incomplete)     AS Ratio
    ,       RANK () OVER ( ORDER BY  complete / (complete + incomplete) ) - 1
                                                        AS decile
    FROM      got_complete
    ORDER BY  complete
    ,            incomplete     DESC
    ;RANK numbers rows 1, 2, 3, ... If I understand your requirements, you want the numbering to start with 0 (meaning "there are 0 other patients with a lower ratio"), so that's why I subtracted 1.
    Depending how you want to handle ties, you may need to add some tie-breaker expressions to the analytic ORDER BY clause, and/or use ROW_NUMBER instead of RANK.
    Here, I used the calculation "complete / (complete + incomplete)" in the ratio column, then repeated it in the decile column.
    I you want, you can add another sub-query, called got_ratio, which would add the ratio column, but do nothing about the decile column. Then, in the main query, you could use RANK as shown above (or, as you suggested, a scalar sub-query referencing got_ratio) to get the number of other pateient_ids with lower ratios.
    On the other hand, you could do this whole job without any sub-queries, using AVG as I did earlier, and then repeating that same AVG expression in the ORDER BY clause for RANK. Aggregate functions are computed before analytic fucntions, so the analytic RANK can referenece the aggregate AVG.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only), and also post the results you want from that data. Include examples of decile ties (2 or more patients with the same ratio).
    Explain, using specific examples, how you get those results from that data.

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

  • No statement parsed error

    I have to first mention that this thing called ORACLE is totally headache. Don't really understand why people choose it. One of those stupid companies is the one where I work.It's just like an "I don't like this, I don't like that"girl. So many problems, so many things you have to coonsider, so many weird exceptions.
    Ok my problem is I have a stored procedure. It receives bunch of parameters one of which is V_CUR OUT SYS_REFCURSOR and another is a V_TYPE IN NUMBER. In the body of my procedure I check for the value of the V_TYPE, if its 0 then the procedure opens V_CUR for a query, if its 1 then the procedure inserts the values passed with rest of the parameters to a table.here are the problems I fase:
    1. If I run this procedure on SQL Developer it executes as expected, but if I do it by using ODP.NET it just takes whatever the default value is for V_TYPE parameter and just ignores the value I pass from the application.
    2. Now the wirdest thing is then if I remove the DEFAULT value from the V_TYPE I get "No statement parsed error".
    Here's my procedure just in case someone will have patience to review it:
    create or replace
    PROCEDURE "SP_IU_AGPENSIONERS"(
    V_PENSIONERID IN NUMBER DEFAULT NULL,
    V_DEPARTID IN NUMBER DEFAULT NULL,
    V_PENSIONTYPE IN NUMBER DEFAULT NULL,
    V_PLASTNAME IN VARCHAR2 DEFAULT NULL,
    V_PNAME IN VARCHAR2 DEFAULT NULL,
    V_PFATHERNAME IN VARCHAR2 DEFAULT NULL,
    V_PERIDTYPE IN NUMBER DEFAULT NULL,
    V_PERIDSER IN VARCHAR2 DEFAULT NULL,
    V_PERIDNO IN VARCHAR2 DEFAULT NULL,
    V_PGENDER IN NUMBER DEFAULT NULL,
    V_PBIRTHDAY IN DATE DEFAULT NULL,
    V_NATIONALITYID IN NUMBER DEFAULT NULL,
    V_PROTOCOLNO IN VARCHAR2 DEFAULT NULL,
    V_ORDERDATE IN DATE DEFAULT NULL,
    V_APPLYDATE IN DATE DEFAULT NULL,
    V_WEYEAR2006 IN NUMBER DEFAULT NULL,
    V_WEMONTH2006 IN NUMBER DEFAULT NULL,
    V_WEDAY2006 IN NUMBER DEFAULT NULL,
    V_ST IN NUMBER DEFAULT NULL,
    V_PFIELD IN NUMBER DEFAULT NULL,
    V_CUR OUT SYS_REFCURSOR,
    V_TYPE IN NUMBER DEFAULT 0)
    IS
    TYPE_SELECT CONSTANT NUMBER:=0;
    TYPE_INSERT CONSTANT NUMBER:=1;
    TYPE_UPDATE CONSTANT NUMBER:=2;
    TYPE_DELETE CONSTANT NUMBER:=3;
    BEGIN
    IF V_TYPE=TYPE_SELECT THEN
    OPEN V_CUR FOR SELECT PENSIONERID, DEPARTID, PENSIONTYPE, PLASTNAME, PNAME,
    PFATHERNAME, PERIDTYPE, PERIDSER, PERIDNO, PGENDER, PBIRTHDAY,
    NATIONALITYID, PROTOCOLNO, ORDERDATE, APPLYDATE, WEYEAR2006, WEMONTH2006,
    WEDAY2006, ST FROM AGAPUS.AGPENSIONERS WHERE ROWNUM<101 ORDER BY
    PENSIONERID;
    ELSIF V_TYPE=TYPE_INSERT THEN
    INSERT
    INTO
    AGPENSIONERS
    PENSIONERID,
    DEPARTID,
    PENSIONTYPE,
    PLASTNAME,
    PNAME,
    PFATHERNAME,
    PERIDTYPE,
    PERIDSER,
    PERIDNO,
    PGENDER,
    PBIRTHDAY,
    NATIONALITYID,
    PROTOCOLNO,
    ORDERDATE,
    APPLYDATE,
    WEYEAR2006,
    WEMONTH2006,
    WEDAY2006,
    PFIELD
    VALUES
    V_PENSIONERID,
    V_DEPARTID,
    V_PENSIONTYPE,
    V_PLASTNAME,
    V_PNAME,
    V_PFATHERNAME,
    V_PERIDTYPE,
    V_PERIDSER,
    V_PERIDNO,
    V_PGENDER,
    V_PBIRTHDAY,
    V_NATIONALITYID,
    V_PROTOCOLNO,
    V_ORDERDATE,
    V_APPLYDATE,
    V_WEYEAR2006,
    V_WEMONTH2006,
    V_WEDAY2006,
    V_PFIELD
    END IF;
    END;
    Edited by: Mikail on Apr 12, 2012 5:12 AM

    Somebody asked nearly the same question Re: EMERGENCY! pl/sql syntax error!!!

  • Premiere CC 2014.1 Blu-ray MPEG 2 export causing error in Sony DVD Architect Pro

    I've filed a Bug Report for this but wanted to post here in case it helps anyone else or on the off chance someone can give me a solution / better work around.
    Something has changed in the results of a Blu-ray MPEG2 export from Premiere 2014.1 vs those of the previous CC version. The result is that my authoring software of choice, Sony DVD Architect Pro, fails to prepare a disc image giving an error in the final stage of preparation. This workflow has been working fine for 2-3 years.
    My work around is to export to original format (mxf / XDCAM EX HQ) and then go back to Media Encoder CC rather than 2014 to produce the Blu-ray MPEG2 file, which works without problem.
    Here's a copy paste of my bug report in case anyone with a similar setup has an opportunity to replicate (I'd be very grateful to anyone able to confirm whether its a bug or something specific to me that I might be able to fix).
    ******BUG******
    Export from Premiere 2014.1 directly or via Media Encoder of MPEG 2 1080 50i Blu-ray files causes error in preparation of Blu-ray disc in Sony DVD Architect 5.2.
    This error does not occur when using the same Media Encode export preset in the previous version of Premiere Pro CC / Media Encoder.
    Steps to reproduce bug:
    1. Export Sequence from Premiere
    Export, in my case XDCAMEX 1080i HQ, using a media encoder MPEG 2 Blu-ray preset:
    Preset Name: HD 1080i 25
    Format: MPEG2 Blu-ray
    Bitrate Settings: Medium (Target 25Mbps)
    2. Create DVD Architect 5.2 project
    Set up as single movie Blu-ray project in DVD Architect:
    Disc format: Blu-ray Disc
    Resolution: 1920*1080
    Framerate: 35 interlaced
    Choose the file exported from Premiere
    3 Prepare Disc
    - Select Make Blu-ray Disc
    - Click Prepare
    - Choose Location of iso
    - click next then finish
    Result
    Around 50% - 60% through the process the following error is displayed:
    An error occurred while preparing compilation
    Details:
    File name: STREAM/00000.m2ts
    Status: TSWrapper.dll::CTSWrapper::ProcThreadMain::Failed to read ES file. - The ES file may be shorter than the size described in the MUI file.
    Expected results:
    A shiny ISO ready to be burnt to disc and sent sent to eager customers.
    Its taken me a full day and a half to isolate problem - someone remind me why I fall for the software updates every time?!
    Cheers
    Iain
    Other details:
    Windows 7 pro 64 SP1
    Intel Core i7 950 @ 3.07GHz
    RAM 24.0GB
    ASUSTeK P6T DELUXE V2
    1279MB NVIDIA GeForce GTX 470

    There is a known bug in the H.264-Bluray export. I assume it has nothing to do with your issue, but perhaps it will give you something to consider.
    https://forums.adobe.com/message/6848505#6848505
    It appears due to a malformed xmpses file. It creates a problem on import into Encore, and I think it should do the same upon import into Architect or it would be ignored entirely. The test is to delete the xmpses file and see if that avoids the issue.

  • Using alias in where statement

    simple sql:
    SELECT EMPLOYEE_ID,
    FIRST_NAME,
    LAST_NAME,
    EMAIL,
    PHONE_NUMBER,
    HIRE_DATE,
    JOB_ID,
    SALARY,
    COMMISSION_PCT,
    MANAGER_ID,
    DEPARTMENT_ID
    FROM EMPLOYEES
    WHERE EMPLOYEE_ID > 1000;
    is it somehow possible to use alias in where statement like
    SELECT EMPLOYEE_ID "ID",
    FIRST_NAME,
    LAST_NAME,
    EMAIL,
    PHONE_NUMBER,
    HIRE_DATE,
    JOB_ID,
    SALARY,
    COMMISSION_PCT,
    MANAGER_ID,
    DEPARTMENT_ID
    FROM EMPLOYEES
    WHERE "ID" > 1000;

    Hi,
    is it somehow possible to use alias in where statement likeWhy do you need it?
    To answer your question "Not directly"
    SQL> select empno eno, sal
      2  from emp
      3  where eno = 7900;
    where eno = 7900
    ERROR at line 3:
    ORA-00904: "ENO": invalid identifierColumn Alias are names given to give meaningful names to columns or the arithmetic operations' column.
    Twinkle

  • Changes in RPCBURZ0 causes errors in other programs

    Hello to All,
    I made changes to RPCBURZ0 in order to extend the TABLE schema function to read a custom Infotype 9001.
    I added the necessary code in RPCBURZ0 and the data definition in RPCFDCZ0.
    The code is working perfectly , but the changes are causing errors in other country specific reports
    specifically in : HINCALC0 , HCNCALC0 , and HKRCALC0 and Transports to Quality generating errors.
    Error is because the custom infotype definition is not seen in these reports.
    Generation of the users of the transported Includes                                                                                |
    Program HCNCALC0, Include RPCBURZ0: Syntax error in line 000021
    The field 'T9001' is unknown, but there is a fieldwith the similar name 'T001P'. .
    Program HINCALC0, Include RPCBURZ0: Syntax error in line 000021
    The field 'T9001' is unknown, but there is a fieldwith the similar name 'T001P'. .
    Program HKRCALC0, Include RPCBURZ0: Syntax error in line 000021
           |   The field 'T9001' is unknown, but there is a fieldwith the similar name 'T001P'. . 
    Looking at other H--CALC0 reports i could easily spot an include for RPCFDCZ0.
    include rpcfdcz0.  "customer-specific data declaration (int'l)
    I wonder why this include is not in (HINCALC0 , HCNCALC0 , and HKRCALC0) !!!
    I have two solutions in mind :
    1. Make a custom ZRPCBURZ0 and include it in the main report.
    2. Look for user exist for the three reports and add the data definition statement .
    What is the best way to fix this situation ? and is there any other possible solutions ?
    We are using :
       SAP ECC 6.0
       Payroll International Driver.

    Alex Gorly and Matt Sullivan solved one of my issues above:
    Message: Attribute 'prod' is not declared for element 'prodname'
    I'm still stumpled on the other one:
    Message: Not enough elements to match content model  '(prodname,vrmlist,((brand|component|featnum|platform|prognum|series) )*)'
    As stated above, I've even removed everything from the general rule of <prodinfo> except prodname and I'm still getting the same error. I've searched everywhere for this general rule and <prodinfo> is the only place I can find it.
    What I really want is: (prodname), (vrmlist)?, (brand | component | featnum | platform | prognum | series)*
    so that vrmlist is optional.
    No matter what I do, unless I include a vrmlist, I get the above message. Currently, our CMS can't handle vrmlist but I don't want to remove it altogether because we may be replacing our CMS.
    Help please!

  • State service error when submitting InfoPath form to Library

    I have a problem and looks like Google couldn't help me.. I really hope someone here will be able to.
    I have a Form Library using a custom form. When submitting the form to the library, users are getting this error. I don't get the error with my own user, only difference is I have full access to the farm and content using web app policy.
    ULS logs give me few informations
    SharePoint Server
    State Service
    bm1k
    Medium
    StateSqlSession.GetItemBytesInternal() Locked row in database for key ba18f90ee2e844468b08e90ad96dff2c_05967b71a21948d39b7d4d3ada9b27c9 for 4 seconds
    SharePoint Server
    State Service
    bm0t
    Unexpected
    StateManager.GetState() Locked data (05967b71-a219-48d3-9b7d-4d3ada9b27c9)
    InfoPath Forms Services
    Runtime - State Service
    b5st
    Medium
    MOSS StateService threw an exception: A Microsoft SharePoint Server State Service error occurred while processing your request. For more information, contact your server farm administrator.
    I deleted the State Service and recreated it twice, once with PowerShell and then with the Farm Configuration wizard. Restarted the server. Problem might come from InfoPath Forms Services tho but I don't what else I can do.
    Does anyone have any clue??
    JP Berube | MCTS SharePoint 2010 Configuration and Application Development

    Hi,
    We had the same problem with InfoPath.
    After analysis of servers,it turns out that
    the anonymous user authentication has been enabled on
    the web application server
    via IIS and not via SharePoint
    (unsupported configuration), causing
    side-effects on some queries which
    calls to forms.
    We disabled anonymous access.This desactivation
    causes the functioning of forms again.
    Rachid.

  • Invalid State Identifier Error

    Hi All,
    I have implemented breadcrumb by using "a href="javascript:history.back()". The naviagtion is upto 5 repots and hence the breadcrumb will have 5 links. The issue is sometimes i get "Invalid State identifier" error with some random number when i click on any link in the breadcrumb.
    Unable to trace the root cause of this issue. Please provide your thoughts.
    Regards,
    Swati

    Thanks!!! Do you have any idea about Invalid state error? I have tried inserting the following as suggested by Oracle but doesnt help much.
    <StatePool>
    <MemoryExpireMinutes> 1440 </MemoryExpireMinutes>
    <DiskCleanupIntervalMinutes> 1440 </DiskCleanupIntervalMinutes>
    </StatePool>
    Regards,
    Swati

  • Left outer join 3 tables with where-statement

    Hi folks,
    I hope you can understand (and maybe solve) my problem.
    Generally I try to left outer join three tables. The third table is used for a WHERE-statement.
    The three table structures are the following:
    table 1 (user)   
    user1 | key
    table 2 (detail)  
    key | ID
    table 3 (header)
    ID | user2                 
    ...and I want to achieve the following structure (as example filled with data):
    user | key | ID
    |-----|----
    xy    | a    | 001
    xy    | b    | #
    z     | b     | #
    The clue ist the usage of the third table. I need the table to set user1 and user2 equal (WHERE) but there are two problems:
    1) Obviously I can't left outer join two tables with each other. In this case I already used the 'key' of table 1 to join it with the 'key' of table 2. So I can't left outer join the 'ID' of table 2 with the 'ID' of table 3. Error message that I can only left outer join a table once. Any proposals?
    2) I have to include a WHERE to equal user1 with user2. But I am not allowed to use the user2 from table 3 because of the left outer join.
    I tried this coding:
    SELECT auser1 akey b~id INTO TABLE itab FROM ( table1 AS a
      LEFT OUTER JOIN table2 AS b ON akey = bkey )
      LEFT OUTER JOIN table3 AS c ON bID = cID )
      WHERE auser1 = cuser2.
    I would really appreciate your help.
    Regards
    MrclSpdl

    IF you want to join a DB table with an internal table, you need to use the 'FOR ALL ENTRIES' statement.
    select dbfields
    into table itab2
    from dbtab
    for all entries in itab
    where dbfield1 = itab-field1.
    This will get you a second internal table with all the corresponding data for the first selection.  You can then join them with a loop through the first table and a read table on the second table (for 1 - 1 relation) or a nested loop statement on both tables (for 1 - N relation).  Make itab a hashed table when using read table with key, use a sorted table if you need to loop without key access.
    Regards,
    Freek

  • Rollback of JDBC Statement on error - Stored Procedure

    Hi All,
    We are using the JBDC receiver adapter for inserting the record and for that we are using the Strored Procedure and we have N number of the records for insertion in a single mapping so, we have given the occurence of the Statement 1 : unbounded as, multiple statement will be executed so, my query is if one of statement fails because of some error(Mapping error or data error) what will happen to the statement which are already executed, do they rollback? or it is not possible in case of stored procedure?
    Regards,
    Gaurav

    Hi,
    This is one of the solution but i guess there is one more issue, if we have 10 statements and third statement shows error and Stored Exception exception branch is able to catch then it will rollback the previous statement but can we able to restrict another 7 pending statement for execution or not?
    Regards,
    Gaurav

  • Where i was error

    When is am attempting to add more than 8 items the action is not loading.
    Here i show below,
    Action implement
    public class AddDesigAction extends Action {
         String target = null;
         public ActionForward execute(ActionMapping mapping,ActionForm form,
              HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException {
                   DesignationForm desigForm = (DesignationForm) form;
                   if(desigForm != null){
                        Designation desig = new Designation();
                        desig.setId(desigForm.getId());
                        desig.setName(desigForm.getName());
                        DesignationOperation.addDesignation(desig,request);
                        desigForm.reset(mapping,request);
                        target= "success";
              return (mapping.findForward(target));
    struts-config.xml
    <action-mappings>
                   <action path="/Home" forward="/Welcome.jsp" />               
                   <action path="/Designation" forward="/Designation.jsp" />
                   <action path="/addDesig" type="phrd.desig.AddDesigAction"
                   name="desigForm" scope="request" input="/Designation.do">
                        <forward name="success" path="/Designation.do" />
                        <forward name="failure" path="/Home.do" />
                   </action>
    </action-mappings>
    my problem is if i am going to add more than 10 times page is not loading.
    I am not clear where i was error, Anybody help please
    Thanks in advance.

    Thanks for your reply,
    What have you guessed is exactly right but i didn't get an error or even exception. After my eight attempt in addition there is no response.
    Here i show you DesignationOperation.addDesignation()
    public static void addDesignation(Designation desig,HttpServletRequest request){
    String strquery="";
    HttpSesson session = request.getSession();
    DataSource ds = (DataSource) session.getAttribute("ds");
    Connection con = null;
    Statement st= null;
    try
    con = ds.getConnection();
    st = con.createStatement();
    strquery = " insert into desig values(" + desig.getId() " + ",'" + desig.getName() + "')";
    st.executeUpdate(strquery);
    }catch(SQLException sqle){System.out.println(sqle);}
    could you guess any bugs in above coding. if there help please
    K.sadagopan

  • GROUP BY with parameter - cause error -ORA-00979: not a GROUP BY expression

    I generate a query via PreparedStatement. For example:
    SELECT when, value FROM test GROUP BY ?;
    PrepState.toString(1, "when");
    That causing error: ORA-00979: not a GROUP BY expression
    My application using query like:
    SELECT to_char(data,1), SUM(vlue) as sum FROM test GROUP BY to_char(data, 2);
    PrepState.toString(1, "YYYY-MM");
    PrepState.toString(2, "YYYY-MM");

    Ah. Reproduced in the first chunk of PL/SQL below.
    The second chunk is a workaround.
    Basically, SQL is parsed by the syntax engine and optimizer to get an execution plan. Then you can have a sequence of "bind, execute, fetch, fetch, fetch..., bind, execute..."
    Since you can have multiple binds for a single SQL parse, then the fact that the first set of binds all happen to have the same value doesn't mean the next set will.
    The optimizer needs to be 100% sure that the value in the select must always be the same as the value in the group by, so you can't have two separate (and therefore potentially different) bind variable mappings. [Given the right circumstances, the optimizer might do all sorts of tricks, such as using materialized views and function-based indexes.]
    Misleadingly, it actually fails on the 'EXECUTE' step of DBMS_SQL rather than the PARSE.
    declare
      v_sql varchar2(1000) :=
        'select to_char(created,:b1), count(*) '||
        ' from user_objects u '||
        ' group by to_char(created,:b2) '||
        ' order by to_char(created,:b3)';
      v_fmt varchar2(10) := 'YYYY';
      v_cur number;
      v_ret_str varchar2(10);
      v_ret_num number;
      v_ret number;
    begin
      v_cur := dbms_sql.open_cursor;
      dbms_sql.parse(v_cur, v_sql, dbms_sql.native );
      dbms_sql.define_column_char (v_cur, 1, v_ret_str, 10);
      dbms_sql.define_column (v_cur, 2, v_ret_num);
      dbms_sql.bind_variable( v_cur, ':b1', v_fmt );
      dbms_sql.bind_variable( v_cur, ':b2', v_fmt );
      dbms_sql.bind_variable( v_cur, ':b3', v_fmt );
      v_ret := dbms_sql.execute( v_cur );
      WHILE ( dbms_sql.fetch_rows(v_cur) > 0 ) LOOP
        dbms_sql.column_value_char (v_cur, 1, v_ret_str );
        dbms_sql.column_value (v_cur, 2, v_ret_num );
        dbms_output.put_line('>'||v_ret_str||':'||v_ret_num);
      END LOOP;
    end;
    declare
      v_sql varchar2(1000) :=
        'select to_char(created,f.fmt), count(*) '||
        ' from user_objects u, (select :b1 fmt from dual) f '||
        ' group by to_char(created,f.fmt) '||
        ' order by to_char(created,f.fmt)';
      v_fmt varchar2(10) := 'YYYY';
      v_cur number;
      v_ret_str varchar2(10);
      v_ret_num number;
      v_ret number;
    begin
      v_cur := dbms_sql.open_cursor;
      dbms_sql.parse(v_cur, v_sql, dbms_sql.native );
      dbms_sql.define_column_char (v_cur, 1, v_ret_str, 10);
      dbms_sql.define_column (v_cur, 2, v_ret_num);
      dbms_sql.bind_variable( v_cur, ':b1', v_fmt );
      v_ret := dbms_sql.execute( v_cur );
      WHILE ( dbms_sql.fetch_rows(v_cur) > 0 ) LOOP
        dbms_sql.column_value_char (v_cur, 1, v_ret_str );
        dbms_sql.column_value (v_cur, 2, v_ret_num );
        dbms_output.put_line('>'||v_ret_str||':'||v_ret_num);
      END LOOP;
    end;
    /

  • Document store access caused errors in the SAP Correction System

    Hi Gurus,
    I have this user who is trying to make changes to a workbook in DEV which is published to a folder with some users who are assigned to role. This user is the only user with Developer 2 role. When the user make changes and try to save the workbook to her role or favorites so that the changes are transported to BWP, the user is getting "Document store access caused errors in the SAP Correction System".
    Do we have any suggestions/solutions, I would really appreciate any help on this.I would also assign full points for the most helpful answer.

    I have exactly the same problem with the user who is trying to save the workbook, where he made minor change.
    Any clues?
    Thank you.
    Vitaliy

Maybe you are looking for

  • Security Exception when loading Image in the background?

    I've written a javafx app running in the browser. It loads a bunch of images in the background. It worked fine prior JRE 7 u11. However it is broken since JRE 7 u13. Images are not loaded correctly, failing with a SecurityException: java.security.Acc

  • How to download the Mountain Lion free as I have the latest MacBook Air?

    I have my MacBook Air purchased after June 07th 2012, and wherein they announced that Mountain ion will be a free download ? Please help me figure out how to get the free copy?

  • Load different xml docs to same database table

    I have 2 different xml documents that contains the information about rows which should be loaded into a database table. File 1: <customer> <name>Company1</name> <city>Helsinki</city> </customer> File 2: <client> <clientname>Company2</clientname> <cli

  • Using fragment library with SAP MIME repository?

    Hi, I am new here so I hope I'm posting this in the right place. We use Adobe LiveCycle Designer as part of the SAP Interactive Forms product. We want to use the fragment library but I am unclear how that will work unless we can connect to the SAP MI

  • Text alignment inside custom text frame

    I created a custom text frame by combining a triangle and a rectangle using Pathfinder->Add but when I added text, this is how it looked --  but I wanted it to look this way.