Oracle存储过程的varchar2输入的默认大小是多少,可以更改吗? [英] What is the default size of a varchar2 input to Oracle stored procedure, and can it be changed?
问题描述
我在Oracle Database 10g中有一个存储过程,其中的输入是varchar2,但是在输入字符串很长(不确定确切长度可能> 8000)时,我无法运行该存储过程.
I have a stored procedure in Oracle Database 10g where my input is a varchar2 but I'm having issues getting it to run when the input string is long (not sure of exact length maybe > 8000).
我的想法是"intext varchar2"(如下所示)默认情况下太小.在需要更长字符串的其他情况下,我可以将varchar2定义为"intext2 VARCHAR2(32767);".我尝试在下面的代码中类似地定义大小,但是我的语法不正确.
My thought is the 'intext varchar2' (as below) is by default is too small. In other cases where I need a longer string I might define a varchar2 as "intext2 VARCHAR2(32767);" I tried to define the size similarly in the code below but my syntax is incorrect.
create or replace PROCEDURE TESTPROC ( intext IN VARCHAR2
) AS ....
intext varchar2的(默认)大小是多少?
What is the (default) size of the intext varchar2?
可以定义(增加)该大小吗?
Can that size be defined (increased)?
谢谢
推荐答案
您无法为过程指定VARCHAR2参数的大小.
You cannot specify a size for a VARCHAR2 parameter to a procedure.
该过程应该愉快地接受最大为32k的字符串(PL/SQL中VARCHAR2的最大大小).如果它是从SQL而不是PL/SQL调用的函数,则限制为4k,因为SQL中VARCHAR2的最大大小仅为4k.
The procedure should happily accept strings up to 32k in size (the maximum size of a VARCHAR2 in PL/SQL). If it were a function that was being called from SQL rather than PL/SQL, the limit would be 4k because the maximum size of a VARCHAR2 in SQL is only 4k.
这篇关于Oracle存储过程的varchar2输入的默认大小是多少,可以更改吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!