Oracle errors

ORA-12899: value too large for column

ORA-12899: value too large for column "SCHEMA"."TABLE"."COLUMN" (actual: N, maximum: M)

A value is longer than the column allows. The message shows the actual and maximum length. With multi-byte data, a column sized in BYTE can overflow even when the text looks short enough — Turkish letters such as ğ, ş and ı take two bytes in AL32UTF8.

What ORA-12899 means

Every VARCHAR2 and CHAR column has a maximum length, in bytes or in characters. When an INSERT or UPDATE would exceed it, Oracle rejects the statement and reports both lengths, e.g. (actual: 23, maximum: 20). If the length is in BYTE and the database character set is AL32UTF8, every non-ASCII character counts as two or more bytes.

Common causes of ORA-12899

How to fix ORA-12899

  1. Compare the actual and maximum values in the message to see how much is missing.
  2. Enlarge the column, preferably with character semantics: ALTER TABLE t MODIFY (col VARCHAR2(50 CHAR)).
  3. Check lengths in bytes and characters: LENGTHB(col) vs LENGTH(col).
  4. Validate or truncate input in the application if the limit is intentional.

ORA-12899 example

Bytes vs characters (AL32UTF8):

SELECT LENGTH('Gümüşhane') AS chars, LENGTHB('Gümüşhane') AS bytes FROM dual;
-- chars = 9, bytes = 12

Size the column in characters:

ALTER TABLE customers MODIFY (city VARCHAR2(50 CHAR));

In SQLlightspeed

When a statement fails, SQLlightspeed’s error panel shows the error code with a plain-language explanation and a suggestion for what to do next, together with Oracle’s own message and a link to Oracle’s documentation — for this error and dozens of other common ones.

Related errors

ORA-06502ORA-01400ORA-01722 All Oracle errors →

Oracle documentation for ORA-12899. Oracle is a registered trademark of Oracle Corporation. SQLlightspeed is not affiliated with Oracle.