Share |

ORA-12899: Value too large for column "%s"."%s"."%s" (actual: %d, maximum: %d)

The value you are trying to insert into a column is too long.

eg:
SQL> create table test(n varchar2(1));

Table created.

SQL> insert into test values ('a');

1 row created.

SQL> insert into test values ('aa');
insert into test values ('aa')
*
ERROR at line 1:
ORA-12899: value too large for column "ME"."TEST"."N" (actual: 2, maximum: 1)
It can happen that the character you are trying to insert looks like there should be no problem:
SQL> desc test
Name Null? Type
----------------------------------------- -------- -----------
N VARCHAR2(1)

SQL> insert into test values ('?');
insert into test values ('?')
*
ERROR at line 1:
ORA-12899: value too large for column "ME"."TEST"."N" (actual: 3, maximum: 1)
This can happen due to the characterset the database is running in.

In a AL32UTF8 (unicode) database, some characters take more then 1 byte.

If you do not specify at create time what unit the size for a column is in, default it means the amount of bytes.

In our example, the ? will take 3 bytes due to the fact we are in a Unicode database and will cause the error.
SQL> select value from nls_database_parameters where parameter='NLS_CHARACTERSET';

VALUE
--------------------------------------------------------------------------------
AL32UTF8
We can fix this by telling that the size is in CHAR's instead of BYTE's:
SQL> alter table test modify(n varchar2(1 char));

Table altered.

SQL> desc test
Name Null? Type
----------------------------------------- -------- -----------------
N VARCHAR2(1 CHAR)

SQL> insert into test values ('?');

1 row created.
 Was this information helpful?  Yes No
If it was not helpful, please take some time to explain why. This is not to ask questions, you can do so in the forum.

Welcome to our forum for Oracle error: ORA-12899 Add your own message



We have upgraded SAP system from 3.6 to 6.0 unicode version. while we are importing the data from SAP to data mart which of Oracle 10g , we got the error message ORA-12899 values larger problem. Even if source and targets are of same type and length, we got this error message. When I tried using NLS_LENGTH_SEMANTICS=CHAR using the alter session set command, it is getting refelected for all altered or newly created column/table. How do make the changes to data base so that, already existing object will consider char instead of bytes.

You can just alter the existing tables:

SQL> create table test(vc varchar2(1));

 

Table created.

 

SQL> desc test

 Name                                      Null?    Type

 ----------------------------------------- -------- ----------------------------

 VC                                                 VARCHAR2(1)

 

SQL> alter table test modify vc varchar2(1 char);

 

Table altered.

 

SQL> desc test

 Name                                      Null?    Type

 ----------------------------------------- -------- ----------------------------

 VC                                                 VARCHAR2(1 CHAR)



 

since we have lot of existing tables in the database with bytes, we will not be able to alter each one of them. Is it possbile to change everyting ie setting in init.ora file wihtout altering all the tables..

This is not possible no, only for new tables when the setting of NLS_LENGTH_SEMANTICS=CHAR

You can create a script based on dba_tab_columns to automate this task

 

 

i am apply all the option but still the error is come

is not solved

You need to find out what length the value is you are trying to insert.

Check the length of the string using the length function. 

You can also dump the content of a string using the dump function

 

Add your message

 Please provide your personal info 



 Please ask your message as briefly and clear as possible 

 Spam Protection 
Validation Code: mykaebda2xhs3wp47


Ask Your Question

If you need more information about this particular error message, you can leave a forum message.

We are replying to this message whenever we have some spare time, so please do not consider this as a private 'solve my critical issue asap' service.

Should you need professional Oracle Assistance to make your project a success, please have a look at our consultancy services.


Spam Protection

In order to prevent automatic generation of messages, we are asking for a validation code. This code is unique and is generated every time a new message is asked.

If you do not enter the validation correctly, your message will not be recorded.


Forum Rules

Please be polite, do not USE ALL UPPERCASE, no insults, violance or any other threats.