Differences between varchar2 and nvarchar2

Source: Internet
Author: User

VARCHAR2 (size) is a variable-length string. Its maximum length is size bytes. The maximum value of size is 4000, and the minimum value is 1. You must specify the size of a VARCHAR2.

NVARCHAR2 (size), a variable-length string. the maximum length of a string is size characters or bytes based on the selected national character set. The maximum size is determined by the number of bytes required for each character. The maximum size is 4000 bytes. You must specify a size for NVARCHAR2.

Differences:

1. When NVARCHAR2 (size is a character) Stores text in, one text is processed as one character

NVARCHAR2 (10) can contain 10 Chinese characters. If it is used to store English letters, it can only contain 10 characters.

NVarchar2 (size is a byte) can only contain 5 Chinese characters or English letters

2. VARCHAR2 contains two Chinese characters.

VARCHAR2 (10) can only contain 5 Chinese characters, and 10 Chinese characters (generally, GBK)

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.