4000+ for varchar2 table column
Ranjan, February 26, 2013 - 11:09 am UTC
Hi Tom,
You explained well.
I didnt understand below thing.
"I can say that soon, this mismatch will go away. Varchar2's in the database will have the same limits as they do in
plsql."
Is that for any 11 g latest release or 12c oracle version or
you meant to say oracle may change in new versions??
I know so far the size of varchar2 for column is 4000!
Regards,
Ranjan
February 26, 2013 - 11:18 am UTC
all I can say is that in 11g and below, the limit is definitely 4000 bytes whereas plsql is 32k. And, this mismatch will go away (future tense) - soon.
:) ,thank You Tom.
Ranjan, February 26, 2013 - 12:37 pm UTC
Kobus du Toit, February 27, 2013 - 1:02 am UTC
12c increases DB VARCHAR2 limit to match PL/SQL
Simon Kissane, November 05, 2013 - 1:14 am UTC
What happened to this nice plan to increase varchar2 size in 12c?
Stephan Eichenlaub, March 14, 2014 - 3:01 pm UTC
Either I missed some configuration or Oracle 12c is not yet capable of longer VARCHAR2. Doing a few simple tests:
select * from v$version;
=> Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
etc.
create table a (word varchar2 (4001));
=> SQL Error: ORA-00910: specified length too long for its datatype
00910. 00000 - "specified length too long for its datatype"
*Cause: for datatypes CHAR and RAW, the length specified was > 2000;
otherwise, the length specified was > 4000.
*Action: use a shorter length or switch to a datatype permitting a
longer length such as a VARCHAR2, LONG CHAR, or LONG RAW
create table a (grp number, word varchar2 (4000));
insert into a (grp, word) select 1, lpad ('1', 2000,'#') from dual;
insert into a (grp, word) select 1, lpad ('2', 2000,'#') from dual;
insert into a (grp, word) select 1, lpad ('3', 2000,'#') from dual;
=> table A created.
1 rows inserted.
1 rows inserted.
1 rows inserted.
SELECT grp, LISTAGG(word,',') WITHIN GROUP( ORDER BY grp) A
FROM a
GROUP BY grp
;
=> ORA-01489: result of string concatenation is too long
01489. 00000 - "result of string concatenation is too long"
*Cause: String concatenation result is more than the maximum size.
*Action: Make sure that the result is less than the maximum size.
Nothing happened with the plan to increase the varchar2 size. It's there.
Gerrat, July 21, 2014 - 2:17 pm UTC
Just as a follow up to Stephan, it is likely you missed a configuration step.
From here: (
http://docs.oracle.com/cd/E16655_01/server.121/e17209/sql_elements001.htm#SQLRF55623 ):
"Beginning with Oracle Database 12c, you can specify a maximum size of 32767 bytes for the VARCHAR2, NVARCHAR2, and RAW data types. You can control whether your database supports this new maximum size by setting the initialization parameter MAX_STRING_SIZE as follows:"