DB2 strings in DB2 Databases

Source: Internet
Author: User

DB2 string is the basic knowledge in DB2 databases. The following section describes DB2 strings for your reference. If you are interested in DB2 strings, take a look.

DB2 string is a byte sequence. DB2 strings include CHAR (n)-type fixed-length strings and variable-length strings of the VARCHAR (n), long varchar, or CLOB (n) type. The length of a string is the number of bytes in the sequence.

* Fixed-length string, CHARACTER (n) or CHAR (n): the length of a fixed-length string is between 1 and 254 bytes. If the length is not specified, it is regarded as 1 byte.

* Variable-length string: a variable-length string of the VARCHAR (n), character varying (n), or char varying (n): VARCHAR (n) type. The maximum length is 32,672 bytes.

* Long varchar: a long varchar string can contain up to 32,700 bytes.

* Character Large Object String), CLOB (n [K | M | G]): CLOB is a variable-length String with a maximum length of 2,147,483,647 bytes. If only n is specified, the value of n is the maximum length. If nK is specified, the maximum length is n * 1, and the maximum value of 024n is 2,097,152 ). If nM is specified, the maximum length is n * 1,048,576 n and the maximum length is 2,048 ). If nG is specified, the maximum length is 2 for n * 1,073,741,824 n ). CLOB is used to store data based on the single-byte character set, SBCS) character set or based on the mixed multi-byte character set MBCS) and SBCS character set. A graphical string is a sequence of Two-byte characters. Graphical strings include fixed-length graphical strings of the GRAPHIC (n) type and variable-length graphical strings of the VARGRAPHIC (n), long vargraphic, and DBCLOB (n) type. The length of a DB2 string is the number of double-byte characters in the sequence.

* Fixed-length graph string, GRAPHIC (n): the length of a fixed-length graph string ranges from 1 to 127 double-byte characters. If the length is not specified, it is considered to be 1 dubyte.

* VARGRAPHIC (n): VARGRAPHIC (n) is a variable-length string with a maximum length of 16,336 double-byte characters.

* Long vargraphic: a long vargraphic string can contain up to 16,350 double-byte characters.

* Double-byte character large object string, DBCLOB (n [K | M | G]): the double-byte character large object is a variable-length double-byte character graphic string, up to 1,073,741,823 characters. If n is specified, n is the maximum length. If nK is specified, the maximum length is n * 1, and the maximum value of 024n is 1,048,576 ). If nM is specified, the maximum length is n * 1,048,576 n and the maximum length is 1,024 ). If nG is specified, the maximum length is 1 for n * 1,073,741,824 n ). DBCLOB is used to store data based on the double-byte character set of big DBCS. A binary string is a byte sequence. Binary strings include BLOB (n)-type variable-length strings, which are used to hold non-traditional data, slice, voice, or hybrid media, it can also accommodate user-defined types and structured data of user-defined functions.

* Binary large object, BLOB (n [K | M | G]): the Binary large object is a variable-length string, which can be up to 2,147,483,647 bytes. If n is specified, n is the maximum length. If nK is specified, the maximum length is n * 1, and the maximum value of 024n is 2,097,152 ). If nM is specified, the maximum length is n * 1,048,576 n and the maximum length is 2,048 ). If nG is specified, the maximum length is 2 for n * 1,073,741,824 n ).
 

Analyze the advantages of the DB2 database

Three types of DB2 clients

Introduction to DB2 database Permissions

Policy Selection for DB2 environment variable Management

Create a DB2 Management Server

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.