I have the following problem:
I have to store in the database the data that is inserted in an input field inside a form. I validate that the data in that input doesn’t exceed 40 chars.
The problem is, if I insert a text that has 40 characters but one of them is accented, then obviously the validation doesn’t show any errors but when it’s going to be stored in the database then the following exception is thrown:
ORA-12899: value too large for column “DBUSER”.”TABLE”.”COLUMN” (actual: 41, maximum: 40)
it seems that the accented character takes up more than one char in the database.
i guess this has to do with the encoding but i have no idea where to start looking. any ideas?
thanks!!
Use
NVARCHAR2as type for the column or make the column at least six times as wide as the longest input (one Unicode character can become at most 6 bytes with the UTF-8 encoding).