oracle - 对于超过 32512 个字符的字符串,PLSQL Developer 中的 dbms_output.put_line 失败并出现 ORA-06502

标签 oracle plsql oracle11g plsqldeveloper dbms-output

此脚本在 PLSQL Developer 版本 14.0.0.1961 中失败(错误 ORA-06502:PL/SQL:数字或值错误:字符串缓冲区太小):

declare
  v varchar2(32767) := rpad('x',32513,'x');
begin
  dbms_output.enable(null);
  dbms_output.put_line(v);
end;
/
  • 如果 32513 被替换为更高的值,它也会失败。
  • 如果 32513 被替换为较低的值,它会起作用(即打印文本而不会失败)。
  • 在 SQL*Plus 和 Toad 中,它最多适用于 32767(这是预期的)。
  • 在 Intellij Idea 中,它最多适用于 32766,对于 32767,它不会引发异常,但不会打印任何内容。

我该如何解释这种行为? 32512 似乎是一个有趣的常量(我在一些 APEX questionquestion about blobs 中找到了它,并且在 JDBC tutorial 中也提到了它,但我错过了与所描述问题的任何联系。)

最佳答案

看起来像是一个 PL/SQL Developer 错误。

2013 年,他们说他们会 fix it :

it's a bit of a low-level issue, so his may need to wait until version 11.0.

你用的是哪个版本?

关于oracle - 对于超过 32512 个字符的字符串,PLSQL Developer 中的 dbms_output.put_line 失败并出现 ORA-06502,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70183116/

相关文章:

oracle - dbms_lob.append 函数错误还是我做错了

oracle - 在PLSQL中如何获取发生异常的过程/函数名称?

c# - 从 C# 中的 PL/SQL 匿名 block 返回游标

sql - Oracle sql - join 和 group by 子句提取订单最多的顶级客户

sql - 显示 Oracle 表的列名

oracle - OWA_UTIL.ident_arr 的类似 NULL 的默认值是什么?

oracle - 如何在 oracle 11g 中插入印度卢比符号?

sql - 使用管理选项创建用户 oracle 11g 命令不起作用

java - select count() 返回耗尽的结果集

sql - Oracle SQL 开发人员 "table or view does not exist"