java - Is the number of characters that can be stored in a VARCHAR2 field influenced by the charset? -


on our customer's database following charset set:

nls_characterset    al32utf8 

on local database following configured:

nls_characterset    al32utf8 

when insert varchar2(4000) column performed on our customer's database error occurrs:

caused by: java.sql.sqlexception: ora-01461: can bind long value insert long column

on computer working fine.

the value bind using java.sql.preparedstatement preparedstatement.setstring(3, value3);.

could error due difference in charset? charset affect amount of characters can stored in varchar2 field?

prior oracle 12.1, varchar2 column limited storing 4000 bytes of data in database character set if declared varchar2(4000 char). since every character in string requires 2 bytes of storage in utf-8 character set, won't able store more 2000 characters in column. of course, number change if of characters require 1 byte of storage or if of them require more 2 bytes of storage.

see this answer.


Comments

Popular posts from this blog

How to provide Authorization & Authentication using Asp.net, C#? -

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

How to use Authorization & Authentication in Asp.net, C#? -