File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Useing IN clause in named/native query

 
pax smith
Ranch Hand
Posts: 45
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have created a query and have used 'IN' clause in it. But when I passed pamater "2,3" it is giving me error. Can anybody give any example in which he/she have used 'IN' clause.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33694
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pax,
You need to know the number of parameters in advance to use "?" binding variables. The alternative is to query objects one (or a fixed bunch) at a time or build the query at runtime.
 
pax smith
Ranch Hand
Posts: 45
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't decide the no. of parameters in advance it is decided at runtime.

I don't want to append it in the query, is there any way to pass values it as parameter

 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33694
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
pax smith wrote:I don't want to append it in the query, is there any way to pass values it as parameter

No.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic