Length of Chinese Character fields stored in Oracle

Source: Internet
Author: User

In the Oracle system, if the remarks field requires 200 Chinese characters, this field is either set to varchar2 (600) or nvarchar2 (200 ).

The following provides a reference for saving the length of Chinese characters in the remarks field of Oracle.

Summary:

1. Varchar2 field. If the number of Chinese characters to be saved is/3, that is, varchar2 (30), 10 Chinese characters must be saved.

2. The nvarchar2 field stores the Chinese character at, that is, the nvarchar2 (30) field. 30 Chinese characters must be saved.

Create table

Createtable test_test (idnumbernotnull, remark_varchar2 varchar2 (10), remark_nvarchar2 nvarchar2 (10 ));

Test the two fields to save the content of 10 Chinese characters in length: 80 or 90"

Test whether varchar2 (10) can save several Chinese Characters

Here, for the varchar2 field, one Chinese character is equal to three lengths.

2. The three Chinese characters "one, two, three" can be saved successfully.

Test whether nvarchar2 (10) can save several Chinese Characters

1. Ten Chinese characters can be saved normally

2. If there are eleven Chinese characters, an error is returned, indicating that the actual length is 11.

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.