-->
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.  [ 2 posts ] 
Author Message
 Post subject: sql query - param pb
PostPosted: Thu Jun 09, 2005 10:56 am 
Newbie

Joined: Mon May 30, 2005 4:26 am
Posts: 4
Hi,
I am new to hibernate. Please help me in resolving the issue I am facing.

I have a query which takes values through params. The problem is I am not able to execute the following query as I get Illegalargument exception.
The param value is not set inside % %.
Is there any thing wrong with using params inside %%?
any alternative for this problem.

Query : FROM table A WHERE :paramseachKey LIKE %:paramsearchValue% AND :paramId =A.Id";

Hibernate version is 2.0


problem is with paramsearchValue.

Thanks,
Mohan


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 10, 2005 11:10 am 
Expert
Expert

Joined: Wed Apr 06, 2005 5:03 pm
Posts: 273
Location: Salt Lake City, Utah, USA
Try this (works in 3.0, not sure about 2.x):

Code:
FROM table A WHERE :paramseachKey LIKE '%' || :paramsearchValue || '%' AND :paramId =A.Id;


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.