You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by Guillaume Morin-Brassard <Gu...@dmr.ca> on 2008/11/10 15:59:12 UTC

ParseException when using UPPER Keyword with an IN CLAUSE

Hi,

 

I'm trying to execute this query :

 

String queryString = "update Instance model set model.excluded = :value where upper(model.name) in (:instances)";

 

But I get the following exception :

 

org.apache.openjpa.persistence.ArgumentException: An error occurred while parsing the query filter 'update Instance model set model.excluded = :value where upper(model.name) in (:instances)'. Error message: <4|false|0.9.7> org.apache.openjpa.kernel.jpql.ParseException: Encountered "upper ( model . name ) in" at character 57, but expected: ["(", ")", "+", "-", ".", ":", "<", "<=", "<>", "=", ">", ">=", "?", "ABS", "ALL", "AND", "ANY", "AS", "ASC", "AVG", "BETWEEN", "BOTH", "BY", "CONCAT", "COUNT", "CURRENT_DATE", "CURRENT_TIME", "CURRENT_TIMESTAMP", "DELETE", "DESC", "DISTINCT", "EMPTY", "ESCAPE", "EXISTS", "FETCH", "FROM", "GROUP", "HAVING", "IN", "INNER", "IS", "JOIN", "LEADING", "LEFT", "LENGTH", "LIKE", "LOCATE", "LOWER", "MAX", "MEMBER", "MIN", "MOD", "NEW", "NOT", "NULL", "OBJECT", "OF", "OR", "ORDER", "OUTER", "SELECT", "SET", "SIZE", "SOME", "SQRT", "SUBSTRING", "SUM", "TRAILING", "TRIM", "UPDATE", "UPPER", "WHERE", <BOOLEAN_LITERAL>, <DECIMAL_LITERAL>, <IDENTIFIER>, <INTEGER_LITERAL>, <STRING_LITERAL>].

 

 

I thought first it was because of the upper keyword but after a couple of tests, it seems that the parser crashes when using a keyword like « upper » with the IN CLAUSE since the following query does not throw any exception. I guess its a parsing bug :

 

String queryString = "update Instance model set model.excluded = :value where upper(model.name) = :instances";

 

Thank you,

 

________________________________________________________

Guillaume Morin-Brassard
Conseiller en livraison de systèmes

Défense & Sécurité Publique

DMR, une division de Fujitsu Consulting (Canada) inc. 

 


Re: ParseException when using UPPER Keyword with an IN CLAUSE

Posted by Pinaki Poddar <pp...@apache.org>.
Fixed on trunk with revision 712842.

-- 
View this message in context: http://n2.nabble.com/ParseException-when-using-UPPER-Keyword-with-an-IN-CLAUSE-tp1480819p1482361.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.