3 Replies Latest reply on May 10, 2004 11:13 AM by sesques

    error about "ORDER BY"

    cold_lin

      It is a simple query.But I can not find out what is wrong.
      My query is: SELECT OBJECT(a) FROM mySchema as a ORDER BY a.NO

      Error msg is:
      org.jboss.deployment.DeploymentException: Error compiling EJB-QL statement 'SELECT OBJECT(a) FROM mySchema as a ORDER BY a.NO'; - nested throwable: (org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "ORDER" at line 1, column 37.
      Was expecting one of:

      "," ...
      )]

      Anyone can help?

      Thanks!

      PS: I try to use ORDERBY instead of ORDER BY but has same error.

        • 1. Re: error about
          sesques

          Hi cold_lin,

          Unfortunatly for you, ORDER BY is not part of the EJB-QL 2.0 spec. Only in EJB-QL 2.1 available only on the JBoss 4.X.X series.

          Pascal

          • 2. Re: error about
            cold_lin

            Thanks for your reply.
            you mean the only choice is to use JBoss 4.X.X if I want to sort?
            it is a very strange isn't it?

            • 3. Re: error about
              sesques

              JBoss is not guilty for that point. EJB-QL is part of the EJB 1.4 spec from SUN. JBoss 4.X.X series is designed to be compliant with this spec release.

              But, you have a solution (from JBoss):
              If you have bought the JBoss doco, you are aware that JBoss allows to override EJB-QL queries with JBOSS-QL. ORDER BY is vailable in JBOSS-QL in 3.2.X series.

              Pascal