PL/SQL Character type

Source: Internet
Author: User

(1) varchar2

Syntax: varchar2 (maxlength)

A variable-length string is stored, and the parameter maxlength indicates that the maximum length of the string can be stored, which must be given when the variable is defined (because VARCHAR2 does not have a default maximum length). The maximum length of the parameter maxlength can be 32767.

The varchar2 maximum length of a database type is 4000 bytes, and a VARCHAR2 variable that exceeds 4000 bytes of PL/SQL cannot be assigned to a VARCHAR2 variable of the database type and can only be assigned to a long type of database variable.

(2) Char

Syntax: char (maxlength)

stores a string of the specified length maxlength, if the value of the variable is less than maxlength, then the Space complete.

The default maximum length for char types is 1. The MaxLength is in bytes, with a maximum of 32767 bytes.

The database type of char can only store 2000 bytes, and PL/SQL's char variable exceeds 2000 bytes, you cannot assign a value to a char variable of the database type.

(3) long

PL/SQL Character type

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.