What is the default size of a varchar2 input to Oracle stored procedure, and can it be changed?

狂风中的少年 提交于 2019-12-19 12:28:08

问题


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).

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 ....

What is the (default) size of the intext varchar2?

Can that size be defined (increased)?

thanks


回答1:


You cannot specify a size for a VARCHAR2 parameter to a procedure.

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.



来源:https://stackoverflow.com/questions/4675417/what-is-the-default-size-of-a-varchar2-input-to-oracle-stored-procedure-and-can

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!