1 Reply Latest reply on Oct 5, 2004 11:53 AM by Tim Shaw

    'IN' in DynamicQL

    Tim Shaw Newbie

      Hi,

      I've just started using DQL in order to execute something like the following statement :
      SELECT OBJECT(o) FROM CusOrderItemEJB o WHERE o.product = ?1 and o.cycle IN (?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13, ?14, ?15, ?16, ?17, ?18)
      This statement is generated (as per the DQL example in the free docs) in an ejbHome method which then calls the ejbSelectGeneric method.

      When I call the method, with the above SQL, I get the following error :
      2004-10-05 14:52:04,289 [http-0.0.0.0-8080-Processor24] ERROR [STDERR] org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "o.cycle IN" at line 1, column 68.
      Was expecting one of:
      "ABS" ...
      "CONCAT" ...
      "COUNT" ...
      "MAX" ...
      "MIN" ...
      "AVG" ...
      "SUM" ...
      "LENGTH" ...
      etc.

      It appears that the compiler doesn't support the SQL 'IN'?

      Surely this has been used ... so what am I doing wrong?

      Regards

      tim

        • 1. Re: 'IN' in DynamicQL
          Tim Shaw Newbie

          I tried to put the query into ejb-ql, to see if that worked (picks it up at deploy-time too, so it's quicker) ...

          MBeanException: org.jboss.deployment.DeploymentException: Error compiling JBossQL statement 'SELECT OBJECT(o)
          FROM CusOrderItemEJB o
          WHERE o.productType = ?1 and o.cycle IN ( ?2 )'; - nested throwable: (org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "o.cycle IN" at line 3, column 52.
          Was expecting one of:
          "ABS" ...
          "CONCAT" ...
          "COUNT" ...


          I get similar behaviour for both JDBCEJBQLCompiler and EJBQLToSQL92Compiler.

          Please help!

          Thanks

          tim