ORA-12899 for a 4-character name in VARCHAR2(10)? Byte vs char length semantics
A VARCHAR2(10) column, a 4-character name, and Oracle says ORA-12899: value too large for column ... (actual: 12, maximum: 10) . If your app stores Korean, Japanese, Chinese, or any other non-ASCII text, you will hit this sooner or later. The cause: the column length counts bytes, not characters . I reproduced it on Oracle AI Database 26ai Free (23.26.3) and ran the check and the fix. All output…
The Oracle error ORA-12899 arises when a 4-character Korean name is stored in a VARCHAR2(10) column. The reason for this error is that the column length counts bytes, not characters. In the AL32UTF8 character set, each non-ASCII character takes up more than one byte, causing the value to exceed the 10-byte limit. To resolve the issue, the column must be defined as VARCHAR2(n CHAR) instead of VARCHAR2(n).
This change ensures that the column length is measured in characters rather than bytes, allowing the 4-character name to fit within the specified limit.
Rewritten by urgent.news; may contain errors — check the original.
Source: dev.to