The following articles mainly describe how to solve the problem of Oracle Chinese Character length. If you are interested in the specific operation related to the problem of Oracle Chinese Character length, the following is a description of the specific solution. I hope it will help you in your future study.
Problem description:
- Varchar2 (4000) abc;
- Intert into table_name (abc) values ('there are 1500 Chinese characters ...... ');
Error: The inserted character is too long! After testing, we found that one Chinese Character occupies 3 bytes, so an error is returned !!!
Problem:
This error may occur if the character set used is UTF8!
Run the following command to View Details:
- SQL> select * from v$nls_parameters where parameter='NLS_CHARACTERSET';
- PARAMETER
- --------------------------------------------------------------------------------
- VALUE
- --------------------------------------------------------------------------------
- NLS_CHARACTERSET
- AL32UTF8
Solution:
We recommend that you use the ZHS16GBK character set!
Operation:
- SQL> SHUTDOWN IMMEDIATE;
- SQL> STARTUP MOUNT;
- SQL> ALTER SYSTEM ENABLE RESTRICTED SESSION;
- SQL> ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0;
- SQL> ALTER DATABASE OPEN;
- SQL> ALTER DATABASE CHARACTER SET AL32UTF8/ZHS16GBK;
- SQL> SHUTDOWN IMMEDIATE;
- SQL> STARTUP;
Solve the problem!
The above content is an introduction to the solution to the problem of Oracle Chinese Character length. I hope you will have some gains.