ORA-01795: maximum number of expressions in a list is 1000
Load Test的时候发现这么如下这个错误....
ORA-01795: maximum number of expressions in a list is 1000
导致这个问题的原因是因为SQL语句中用到了IN字句,结果IN中的元素个数超过了1000导致了这个错误。如下所示...

declare
l_cnt pls_integer;
l_list varchar2(32767);
begin
select listagg(level, ',') WITHIN group(order by level)
into l_list
from dual connect by level<=1000; execute immediate 'select count(*) from user_objects where object_id in (' || l_list || ')'
into l_cnt;
end;
/

这个例子中in中元素个数是1000, 可以正常运行,但是下面这个例子就会报错,因为IN中的元素个数超过了1000...

declare
l_cnt pls_integer;
l_list varchar2(32767);
begin
select listagg(level, ',') WITHIN group(order by level)
into l_list
from dual connect by level<=1001; execute immediate 'select count(*) from user_objects where object_id in (' || l_list || ')'
into l_cnt;
end;
/

解决这个问题的方法是在程序中将一个IN改成多个IN, 或者把IN List 改成一个SELECT语句,把IN List中的元素放到一个Nested Table中。
ORA-01795: maximum number of expressions in a list is 1000的更多相关文章
- 错误:maximum number of expressions in a list is 1000
某一日发现这么如下这么一个错误 --> maximum number of expressions in a list is 1000 原因:因为SQL语句中用到了IN字句,而IN中的元素个数 ...
- iOS---The maximum number of apps for free development profiles has been reached.
真机调试免费App ID出现的问题The maximum number of apps for free development profiles has been reached.免费应用程序调试最 ...
- [LeetCode] Third Maximum Number 第三大的数
Given a non-empty array of integers, return the third maximum number in this array. If it does not e ...
- [LeetCode] Create Maximum Number 创建最大数
Given two arrays of length m and n with digits 0-9 representing two numbers. Create the maximum numb ...
- LeetCode 414 Third Maximum Number
Problem: Given a non-empty array of integers, return the third maximum number in this array. If it d ...
- Failed to connect to database. Maximum number of conections to instance exceeded
我们大体都知道ArcSDE的连接数有 48 的限制,很多人也知道这个参数可以修改,并且每种操作系统能支持的最大连接数是不同的. 如果应用报错:超出系统最大连接数 该如何处理? 两种解决办法: 第一,首 ...
- POJ2699 The Maximum Number of Strong Kings
Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 2102 Accepted: 975 Description A tour ...
- [LintCode] Create Maximum Number 创建最大数
Given two arrays of length m and n with digits 0-9 representing two numbers. Create the maximum numb ...
- tomcat 大并发报错 Maximum number of threads (200) created for connector with address null and port 8080
1.INFO: Maximum number of threads (200) created for connector with address null and port 8091 说明:最大线 ...
随机推荐
- XMU 1246
http://acm.xmu.edu.cn/JudgeOnline/problem.php?id=1246 求区间内素数个数,经典问题,区间长度10^6,数的取值最多能到10^12(此题范围稍小) 用 ...
- 最大流之dinic
先用bfs预处理出层次图,然后在层次图上用dfs找增广路径,理论复杂度O(n*n*m) const int INF=0xfffffff ; struct node { int s,t,cap,nxt ...
- ubuntu 11.04 old sources.list
#deb cdrom:[Ubuntu 11.04 _Natty Narwhal_ - Release amd64 (20110427.1)]/ natty main restricted # See ...
- springboot整合mybatis增删改查(二):springboot热部署
SpringBoot整合热部署 传统情况下, 我们用idea运行springboot程序时, 如果我们需要修改类里的方法,或者其他信息 我们需要修改完保存,并且重启springboot,有时候会很浪费 ...
- 中南林业科技大学第十一届程序设计大赛-C:有趣的二进制
链接:https://www.nowcoder.com/acm/contest/124/C来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 131072K,其他语言26214 ...
- (译)KVO的内部实现
09年的一篇文章,比较深入地阐述了KVO的内部实现. KVO是实现Cocoa Bindings的基础,它提供了一种方法,当某个属性改变时,相应的objects会被通知到.在其他语言中,这种观察者模 ...
- windows下Java调用mysql的客户端备份和恢复
这种东西没啥好聊的,其实就是Java执行dos界面下的命令,不过有些要注意就是了,真实dos下面的命令和java调用的windows系统的接口其实还是有一点不同. /** * @param hostI ...
- 白帽子讲web安全——白帽子兵法(设计安全方案中的技巧)
1.Secure By Default原则 白名单:筛选出被允许的,屏蔽其他. 黑名单:屏蔽可能造成的威胁. 2.XSS和SSH XSS攻击:跨站脚本(cross site script)攻击是指恶意 ...
- ES6必知必会 (八)—— async 函数
async 函数 1.ES2017 标准引入了 async 函数,它是对 Generator 函数的改进 , 我们先看一个读取文件的例子: Generator 写法是这样的 : var fs = re ...
- IT项目管理的十六个字心得体会
目标驱动,系统思维,风险意识,数据量化 凡事预则立,不预则废.如果你不知道要到哪里?给你一张地图也没有用.目标驱动首先要有最基本的计划管理和时间管理能力.对于一个项目,我们过程中做的所有工作都是为了要 ...