0 Replies Latest reply on Aug 24, 2006 7:04 AM by amit.patel

    Problem while using Inner Query

    amit.patel

      Hi All,

      [CDATA[SELECT OBJECT(obj) FROM UpdateWebMessageText obj WHERE obj.messageType = ?1 and obj.effectiveStartDate = (SELECT min(obj1.effectiveStartDate) FROM UpdateWebMessageText obj1
      WHERE obj1.messageType = ?1 and obj1.effectiveStartDate > ?2 )]].

      While using above query, jboss is giving follwing error

      Problem starting service jboss.j2ee:jndiName=ejb/bean/WebMessageTextEJB,service=EJB
      org.jboss.deployment.DeploymentException: Error compiling EJB-QL statement 'Select OBJECT(obj) FROM UpdateWebMessageText obj WHERE obj.messa
      geType = ?1 and obj.effectiveStartDate = (SELECT max(obj1.effectiveStartDate) FROM UpdateWebMessageText obj1
      WHERE obj1.messageType = ?1 and obj1.effectiveStartDate < ?2 )'; - nested throwabl
      e: (org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "(" at line 1, column 109.
      Was expecting one of:
      <DATETIME_VALUED_PARAMETER> ...
      <DATETIME_VALUED_PATH> ...
      ).

      It seems from the message that jboss expects date value(in query, i have made that portion red) but it found '(' there.

      Actually after '(' is a query which returns date, but jboss doesn't allows to write inner queries.

      Please provide me help how to solve this.

      Thanks in Advance,
      Amit.