ORA-01489: result of string concatenation is too long
ORA-01489: result of string concatenation is too long
Cause: String concatenation result is more than the maximum size.
Action: Make sure that the result is less than the maximum size. Reference:
http://nimishgarg.blogspot.com/2012/06/ora-01489-result-of-string.html
http://docs.oracle.com/cd/B19306_01/server.102/b14219/e900.htm Example:
SQL> SELECT LPAD('x',4000,'x') || LPAD('x',4000,'x') || LPAD('x',4000,'x') FROM DUAL;
SELECT LPAD('x',4000,'x') || LPAD('x',4000,'x') || LPAD('x',4000,'x') FROM DUAL
*
ERROR at line 1:
ORA-01489: result of string concatenation is too long Problem Description:
The problem with this query is with the use of CONCAT operator (||). e.g.: select char1 || char2 from dual
Concat operator returns char1 concatenated with char2. The string returned is in the
same character set as char1. So here concat operator is trying to return varchar2,
which has limit of 4000 characters and getting exceeded. This problem may also come when we try to CONCAT a VARCHAR2 with CLOB.
e.g.: select char1 || clob from dual So here we can simply convert its first string to CLOB and avoid this error.
After converting first string to CLOB, CONCAT operator will return string of CLOB type Solution:
SELECT TO_CLOB(LPAD('x',4000,'x')) || LPAD('x',4000,'x') || LPAD('x',4000,'x')
FROM DUAL
ORA-01489: result of string concatenation is too long的更多相关文章
- Effective Java 51 Beware the performance of string concatenation
Using the string concatenation operator repeatedly to concatenate n strings requires time quadratic ...
- StringBuffer使用append提示String concatenation as argument to 'StringBuffer.append()' call
昨天发现一个IDE提示: String concatenation as argument to 'StringBuffer.append()' call less... (Ctrl+F1) Repo ...
- C. The Smallest String Concatenation
C. The Smallest String Concatenation time limit per test 3 seconds memory limit per test 256 megabyt ...
- codeforces 632C The Smallest String Concatenation
The Smallest String Concatenation 题目链接:http://codeforces.com/problemset/problem/632/C ——每天在线,欢迎留言谈论. ...
- CodeForces 632C The Smallest String Concatenation//用string和sort就好了&&string的基础用法
Description You're given a list of n strings a1, a2, ..., an. You'd like to concatenate them togethe ...
- Educational Codeforces Round 9 C. The Smallest String Concatenation 排序
C. The Smallest String Concatenation 题目连接: http://www.codeforces.com/contest/632/problem/C Descripti ...
- codeforces 632C C. The Smallest String Concatenation(sort)
C. The Smallest String Concatenation time limit per test 3 seconds memory limit per test 256 megabyt ...
- Educational Codeforces Round 9 C. The Smallest String Concatenation —— 贪心 + 字符串
题目链接:http://codeforces.com/problemset/problem/632/C C. The Smallest String Concatenation time limit ...
- Educational Codeforces Round 9 C. The Smallest String Concatenation(字符串排序)
You're given a list of n strings a1, a2, ..., an. You'd like to concatenate them together in some or ...
随机推荐
- 网易实习笔试真题C/C++
刚做的时候根本就没有想到解题思路,刚好看到了别人的思路,自己写了一下.里面对unordered_map及vector二维数组的建立很灵活,另外区别了一下map,unordered_map,hash_m ...
- 隐藏apache版本号 PHP版本号
httpd-default.conf ServerTokens Prod ServerSignature Off php.ini expose_php Off 重启服务器
- scanf()/getchar()和gets()深入分析
C/C++学习笔记1 - 深入了解scanf()/getchar()和gets()等函数 ---------------------------------------------------- | ...
- LeetCode(1) -Two Sum
题目要求很简单,给你一个数组(例如,nums = [2,7,11,15])和一个target(target = 9),找到数组里两个数相加后能得到target的这两个数的index.在本例中,返回的应 ...
- PySpark调用自定义jar包
在开发PySpark程序时通常会需要用到Java的对象,而PySpark本身也是建立在Java API之上,通过Py4j来创建JavaSparkContext. 这里有几点是需要注意的 1. Py4j ...
- mysql 全文查找fulltext
从 Mysql 4.0 开始就支持全文索引功能,但是 Mysql 默认的最小索引长度是 4.如果是英文默认值是比较合理的,但是中文绝大部分词都是2个字符,这就导致小于4个字的词都不能被索引,全文索引功 ...
- C#完整的通信代码(点对点,点对多,同步,异步,UDP,TCP)
C# code namespace UDPServer { class Program { static void Main(string[] args) { int recv; byte[] dat ...
- C++的双冒号(域解析符)
在C++中,“::”表示“作用域标识符”或者叫“作用域分解运算符”,比如:“类名::函数名”,这样是表示该函数是该类的成员函数, 但是象下面这种写法:“::函数名”,作用域标识符前面没有任何对象,代表 ...
- mysql show processlist 命令详解
命令格式 SHOW [FULL] PROCESSLIST SHOW PROCESSLIST显示哪些线程正在运行.您也可以使用mysqladmin processlist语句得到此信息.如果您有SUPE ...
- VS2010 用WebBrowser控件 无响应
问题:偶尔我遇到这个问题,不知怎么的,拖放这个web控件它就卡死,无法响应,其他应用程序没有影响,任务管理器显示无法响应. 解决:原来是有道翻译的问题,具体为什么不清楚,只要一打开有道翻译,用web控 ...