-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: lower
PostPosted: Mon Apr 11, 2005 4:44 pm 
Newbie

Joined: Wed Mar 23, 2005 2:32 pm
Posts: 12
Hibernate v 3.0 rc1
DB2 8.1

I have the following query which does not work:
String querySelect = "from Product as product "
+ "where lower(product.name)=lower(:name)";

However, the following works:
+ "where lower(product.name)=:name";

Something to do the lower call. Any ideas. TIA.

DEBUG QueryTranslatorImpl:177 - HQL: from test.hibernate.Product as product where lower(product.name)=lower(:name)
DEBUG QueryTranslatorImpl:178 - SQL: select product0_.id as id, product0_.name as name2_, product0_.price as price2_, product0_.amount as amount2_ from DB2ADMIN.products product0_ where (lower(product0_.name)=lower(?))
DEBUG AbstractBatcher:258 - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
DEBUG AbstractBatcher:379 - opening JDBC connection
DEBUG DriverManagerConnectionProvider:93 - total checked-out connections: 0
DEBUG DriverManagerConnectionProvider:99 - using pooled JDBC connection, pool size: 0
DEBUG SQL:292 - select product0_.id as id, product0_.name as name2_, product0_.price as price2_, product0_.amount as amount2_ from DB2ADMIN.products product0_ where (lower(product0_.name)=lower(?))
Hibernate: select product0_.id as id, product0_.name as name2_, product0_.price as price2_, product0_.amount as amount2_ from DB2ADMIN.products product0_ where (lower(product0_.name)=lower(?))
DEBUG AbstractBatcher:343 - preparing statement
DEBUG QueryLoader:228 - bindNamedParameters() coffee -> name [1]
DEBUG AbstractBatcher:266 - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
DEBUG AbstractBatcher:363 - closing statement
DEBUG JDBCExceptionReporter:49 - could not execute query [select product0_.id as id, product0_.name as name2_, product0_.price as price2_, product0_.amount as amount2_ from DB2ADMIN.products product0_ where (lower(product0_.name)=lower(?))]
com.ibm.db2.jcc.c.SqlException: DB2 SQL error: SQLCODE: -418, SQLSTATE: 42610, SQLERRMC: null


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 31, 2005 2:51 am 
Newbie

Joined: Thu Mar 03, 2005 3:46 am
Posts: 1
I have the same problem with DB2 8.1 and Hibernate 2.1.8.

I've found a comment in a different thread where there was a comment in a pastes mapping file stating that:

DB2 doesn't support placeholders in UPPER and LOWER functions.

It seems indeed to be a DB2 limitation, and I was wondering of somebody found a way around it or could explain the limitation in more detail.

Cheers,
Jens


Top
 Profile  
 
 Post subject: Re: lower
PostPosted: Thu Nov 05, 2009 7:54 am 
Beginner
Beginner

Joined: Wed Jul 09, 2008 5:34 am
Posts: 41
Location: Brno, Czech Republic
https://jira.jboss.org/jira/browse/JBPAPP-3056


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.