chaitu chaitu
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)?
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)?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
select val from table where (col in (1...1000) or col in (1001...2000) )
but it is not efficient but works.
have look at this;
http://www.dbforums.com/showthread.php?t=369013
http://www.dbforums.com/showthread.php?t=369013
only if the expression is a query.