Solutions to Oracle Chinese Character length problems

Source: Internet
Author: User

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:

 
 
  1. Varchar2 (4000) abc;
  2. 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:

 
 
  1. SQL> select * from v$nls_parameters where parameter='NLS_CHARACTERSET';  
  2. PARAMETER  
  3. --------------------------------------------------------------------------------  
  4. VALUE  
  5. --------------------------------------------------------------------------------  
  6. NLS_CHARACTERSET  
  7. AL32UTF8  

Solution:

We recommend that you use the ZHS16GBK character set!

Operation:

 
 
  1. SQL> SHUTDOWN IMMEDIATE;  
  2. SQL> STARTUP MOUNT;  
  3. SQL> ALTER SYSTEM ENABLE RESTRICTED SESSION;  
  4. SQL> ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0;  
  5. SQL> ALTER DATABASE OPEN;  
  6. SQL> ALTER DATABASE CHARACTER SET AL32UTF8/ZHS16GBK;  
  7. SQL> SHUTDOWN IMMEDIATE;  
  8. 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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.