Detailed description of the maximum length of varchar2 characters in Oracle

Source: Internet
Author: User

The maximum length of varchar2 storage is 4000.

The statement is as follows:

Create table test (id varchar2 (4001); an error is reported during execution.

If you change the statement to the following, the execution is successful.

Create table test (id varchar2 (4000 ));

Problem analysis

When used to define the table type, the maximum length of varchar2 is 4000 bytes, as shown in Figure 1. When the value exceeds, an error is returned:

Figure 1:

When used as a variable defined in PL/SQL programs, the maximum size is 32767 bytes. The number of characters that can be stored depends on the character set settings, as shown in figure 2:

Figure 2:

When the string to be stored exceeds the maximum limit of varchar2, you must consider using a large object type CLOB or BLOB.

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.