openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ravi P Palacherla (JIRA)" <>
Subject [jira] Created: (OPENJPA-997) JPQL with MAX and SIZE together throws an error on MS SQLserver
Date Tue, 24 Mar 2009 21:37:52 GMT
JPQL with MAX and SIZE together throws an error on MS SQLserver

                 Key: OPENJPA-997
             Project: OpenJPA
          Issue Type: Bug
          Components: query, sql
    Affects Versions: 2.0.0
         Environment: MS SQL Version: SQL Server 2000 SP3
JDBC driver : Microsoft SQL Server 2000 Driver for JDBC 
            Reporter: Ravi P Palacherla

Run the JPQL "SELECT MAX(SIZE(d.slist)) FROM Department d" on SQLServer fail with error.
But it works fine on other database like Oracle.

Here is the error:
Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: Cannot perform an
 aggregate function on an expression containing an aggregate or a subquery. {prep
 stmnt 8926039 SELECT MAX((SELECT COUNT(*) FROM STUD_DEP WHERE STUD_DEP.DEP_ID = FROM Department t0} [code=130, state=S1000]
         at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingCo
         at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.access$700(Log
         at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnect
         at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(
         at org.apache.openjpa.jdbc.kernel.JDBCStoreManager$CancelPreparedStateme
         at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(
         at org.apache.openjpa.jdbc.sql.SelectImpl.executeQuery(
         at org.apache.openjpa.jdbc.sql.SelectImpl.execute(
         at org.apache.openjpa.jdbc.sql.SelectImpl.execute(
         at org.apache.openjpa.jdbc.sql.LogicalUnion$UnionSelect.execute(LogicalU
         at org.apache.openjpa.jdbc.sql.LogicalUnion.execute(
         at org.apache.openjpa.jdbc.sql.LogicalUnion.execute(
         at org.apache.openjpa.kernel.QueryImpl$
         at org.apache.openjpa.kernel.QueryImpl.singleResult(
         at org.apache.openjpa.kernel.QueryImpl.toResult(
         at org.apache.openjpa.kernel.QueryImpl.execute(
         at org.apache.openjpa.kernel.QueryImpl.execute(
         ... 33 more

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message