• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 8131
  • Last Modified:

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)?
0
chaitu chaitu
Asked:
chaitu chaitu
  • 2
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
>can i accomidate more than 1000 expressions
only if the expression is a query.


0
 
Ashish PatelCommented:
As said you cannot, So what you can do as a work around is put all those values in a temporary table and then write IN (Select Value From TempTable) kindoff.
0
 
ysnkyCommented:
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.
0
 
ysnkyCommented:
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now