ORA-19011:字符串缓冲区太小ORA-06512 Oracle

时间:2014-08-14 20:42:41

标签: sql database oracle plsql

您好我收到以下错误。我应该做哪些更改以容纳此变量的最大大小

[错误]执行(1:1):ORA-19011:字符串缓冲区太小 ORA-06512:第4行

DECLARE
c_var CLOB;
BEGIN
SELECT 
RTRIM(XMLAGG(XMLELEMENT(E,'''' ||code|| ''' AS '||code||',')ORDER BY code).extract('//text()'),',')

INTO c_var FROM (SELECT DISTINCT Code from table_A);

DBMS_OUTPUT.PUT_LINE (c_var);
END;

1 个答案:

答案 0 :(得分:0)

如果你想连接table_A中代码列的不同值。请使用以下查询。

select listagg(Code, ',') within group (order by Code)
from (   select distinct Code 
          from table_A)