14

在 Oracle PL/SQL 中创建过程(或函数)时,不能指定 varchar2 参数的最大长度,只能指定数据类型。例如

create or replace procedure testproc(arg1 in varchar2) is
begin
  null;
end;

您知道可以作为 arg1 参数传递给 Oracle 中此过程的字符串的最大长度吗?

4

3 回答 3

16

在 PL/SQL 过程中它可能高达 32KB

更多信息在这里:http: //it.toolbox.com/blogs/oracle-guide/learn-oracle-sql-and-plsql-datatypes-strings-10804

于 2008-10-09T08:35:34.227 回答
10

我尝试使用 testproc( lpad( ' ', 32767, ' ' ) ) 并且它有效。

32768 字节失败,所以它是 32K - 1 字节

于 2008-10-09T08:43:03.557 回答
3

VARCHAR2在 PL/SQL 中,自 10gR2 以来数据类型的最大大小为32767 字节(可能更早,但我刚刚检查了该版本的文档)。

文档参考:

于 2014-02-27T06:26:16.097 回答