ORA-01489: result of string concatenation is too long
2013-09-03 14:20
1011 查看
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
相关文章推荐
- 【GCC调试程序C语言问题】error: initializer-string for array of chars is too long [-fpermissive]
- ORA-00838: Specified value of MEMORY_TARGET is too small
- IIS "Bad Request - Request Too Long. HTTP Error 400. The size of the request headers is too long."
- ORA-00838: Specified value of MEMORY_TARGET is too small
- ORA-01704: string literal too long
- ora-12169:Net service name given as connect identifier is too long
- Use of uninitialized value in concatenation (.) or string at test.pl line 232
- 超過 Oracle 的長度限制 ORA-00972: identifier is too long
- Determine whether the concatenation of a and b in this order is a square number.
- ORA-14037: partition bound of partition "T1_198012" is too high
- ORA-00838: Specified value of MEMORY_TARGET is too small
- 【ORA】Specified value of MEMORY_TARGET is too small, needs to be at least 3072M解决办法
- ORA-00838: Specified value of MEMORY_TARGET is too small
- oracle错误(三) ORA-00972 identifier is too long 的解决办法
- 【leetcode】String——Substring with Concatenation of All Words(30)
- The request filtering module is configured to deny a request where the query string is too long问题解决
- ORA-20002: Version of statistics table APPLSYS.FND_STATTAB is too old.
- Caused exception message is: ORA-01789: query block has incorrect number of result columns
- ORA-00838: Specified value of MEMORY_TARGET is too small(转)
- An Efficient Method of String Concatenation