导致:java.sql.SQLException:ORA-01795:列表中的表达式的最大数量是1000? [英] Caused by: java.sql.SQLException: ORA-01795: maximum number of expressions in a list is 1000?
问题描述
导致:java.sql.SQLException:ORA-01795:表达式的最大数量一个列表是1000
解决问题我将列表拆分成子列表,每个子列表将有1000个条目。对于每一千条我发射查询。它是工作正常。
请澄清我,有没有更好的解决方案?
谢谢!
这是一个Oracle限制,这就是为什么它有一个Oracle错误代码......虽然你可能会认为这是Hibernate的限制它不会透明地解决它:)
你应该把这个列表放到一个临时表中并加入,假定Oracle没有任何类似SQL Server 表值参数。 (或者你可以将你的查询分解成多个查询,这取决于你在做什么。)
I am using java/hibernate/Oracle. i have a list with more than 3000 entries. if i pass whole list i get below exception.
Caused by: java.sql.SQLException: ORA-01795: maximum number of expressions in a list is 1000
to solve the issue i am splitting the list into sublists, each sublist will have 1000 entries. for every thousand entries i am firing a query. it is working fine.
Please clarify me, is there any better solution?
Thanks!
It's an Oracle limitation, which is why it's got an Oracle error code... although you could argue that it's a limitation of Hibernate that it doesn't transparently work around it :)
You should probably put the list into a temporary table and join on that, assuming Oracle doesn't have anything like SQL Server's table-valued parameters. (Or you could break your query up into multiple queries, potentailly - it depends on what you're doing.)
这篇关于导致:java.sql.SQLException:ORA-01795:列表中的表达式的最大数量是1000?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!