File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Oracle/OAS and the fly likes How to search for an array of values in a Table Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "How to search for an array of values in a Table" Watch "How to search for an array of values in a Table" New topic
Author

How to search for an array of values in a Table

Robo Fazak
Greenhorn

Joined: Mar 25, 2010
Posts: 8
Hi All,

I have an Array of size around 500, which contains bill numbers. I want to search whether these values are in database or not.

I can easily write Select count (id) from Table where BNO=Array [0]; I am using little java also here because I am writing the code in java. But I have to run this query for 500 times if I need to search all values. I can’t use SPs in my application.

So is there any way I can do this in a simple way.

Thanks


SCJP 1.6
Tom Reilly
Rancher

Joined: Jun 01, 2010
Posts: 618
Have you considered using an "in" clause in your SQL?
 
 
subject: How to search for an array of values in a Table
 
Similar Threads
Random Question Generator
How to build smart key / value structure from input
Help with SQL
inserting a new column to an existing oracle table with a fixed value in all the rows of that column
Boolean arrays in java