Oracle: Putting more than 1,000 values using the IN clause

1153200 pts.
Tags:
Oracle
Oracle 10g
Would there be a way to put more than 1,000 values in Oracle 10g using a static IN clause? I currently have a comma delimited list of IDs that I would like to use in the IN clause. When I hit 1,000 items, Oracle is giving me an error. Here's the query I'm using:
select * from table1 where ID in (1,2,3,4,...,1001,1002,...)
Thanks!
1

Answer Wiki

Thanks. We'll let you know when a new response is added.

Your best bet might be to create a table and import your IDs into it, then use a subquery from the new temporary table for the main query’s IN clause.

To import the data you could use any text editor to replace commas by new lines, and then use SQL Developer to import the file into the table.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: