-
I created a stored function. The function has a parameter. The parameter type is varchar2. I used jdbc called the stored function. The parameter in java is string. I want to know the max length of the varchar2 parameter in oracle. Would you tell me?
please help.
thanks
-
Hi,
The maximum length of VARCHAR2 data is 4000 bytes when creating a table with VARCHAR2 columns,
but when using stored procedures/functions the maximum if VARCHAR2 data is 32767.
create table T1 (a varchar2(4001));
will succeed.
create table T1 (a varchar2(4001));
will fail.
declare
str varchar2(32767);
begin
null;
end;
/
will work
declare
str varchar2(32768);
begin
null;
end;
/
will fail
regards,
dbaora
-
mistake :(
I wanted to write:
create table T1 (a varchar2(4000));
will succeed.
create table T1 (a varchar2(4001));
will fail.
regards.
-
thanks very much
-
If the database varchar2 column is 4k. In PL/SQL, you can define a varchar2 variable up to 32K. Note that if you want to insert this variable into a database column you have to trim it to 4k.
[Edited by kris109 on 03-05-2002 at 02:43 PM]