ORA-01795:在列表中的前pressions的最大数量为1000 [英] ORA-01795: maximum number of expressions in a list is 1000

查看:143
本文介绍了ORA-01795:在列表中的前pressions的最大数量为1000的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在C#中,我们正在建设的NHibernate一个包含声明中的查询。前pressions的数量跨越5000如果我执行查询我得到一个错误。

In c# we are building a query for NHibernate containing an "in statement". The number of expressions are crossing over 5000. If I execute the query I get an error.

我需要找到突破大字符串生成器,并将它们存储在字符串生成的数组,如果需要,以获得所需的输出执行多个查询的好办法。我们有拥有超过5000条记录,其余均低于100。可有人提出一个方法来解决这个只有一个帐户?

I need to find a good way to break the large string builder and store them in an array of string builder and execute multiple queries if needed to get the desired output. We have only one account that has over 5000 records and the rest are all below 100. Can someone suggest a way to resolve this?

推荐答案

我用的解决方案是拆分

The solution I have used is to split the IN with OR.

where A in (a,b,c,d,e,f)

变为

where (A in (a,b,c) OR a in (d,e,f)) ...

这是简单的,并规定无特殊要求的查询格式。

This is straightforward and imposes no special requirements to the format of the query.

在我看来,这是更容易在你的StringBuilder来实现(SQLQuerybuilder或不管它在你的情况就是所谓的)比其他一些建议的解决方案。

Seems to me that this is easier to implement in your stringbuilder (SQLQuerybuilder or whatever it's called in your case) than some other suggested solutions.

这篇关于ORA-01795:在列表中的前pressions的最大数量为1000的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆