Link to home
Start Free TrialLog in
Avatar of chaitu chaitu
chaitu chaituFlag for India

asked on

ORA-01795: maximum number of expressions in a list is 1000

i have an application that is running against an oracle10g database.  when i try to perform certain operations in the application, it comes back with the error:

ORA-01795: maximum number of expressions in a list is 1000

then, i look at the sql that is generated and i have:

select <some things> from <table> where <a thing> IN (thing1, thing2, 1000+ more);



can i accomidate more than 1000 expressions in IN clause?if not accomdate in oracle how to write it in java(if there are 5000 records)?
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

>can i accomidate more than 1000 expressions
only if the expression is a query.


ASKER CERTIFIED SOLUTION
Avatar of Ashish Patel
Ashish Patel
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
you can split if more than 1000 like this;
select val from table where (col in (1...1000) or col in (1001...2000) )

but it is not efficient but works.