OceanBase logo

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Resources

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS

OceanBase Cloud

OceanBase Database

Tools

Connectors and Middleware

QUICK START

OceanBase Cloud

OceanBase Database

BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Company

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

International - English
中国站 - 简体中文
日本 - 日本語
Sign In
Start on Cloud

A unified distributed database ready for your transactional, analytical, and AI workloads.

DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS
OceanBase CloudOceanBase Database
ToolsConnectors and Middleware
QUICK START
OceanBase CloudOceanBase Database
BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

Start on Cloud
编组
All Products
    • Databases
    • iconOceanBase Database
    • iconOceanBase Cloud
    • iconOceanBase Tugraph
    • iconInteractive Tutorials
    • iconOceanBase Best Practices
    • Tools
    • iconOceanBase Cloud Platform
    • iconOceanBase Migration Service
    • iconOceanBase Developer Center
    • iconOceanBase Migration Assessment
    • iconOceanBase Admin Tool
    • iconOceanBase Loader and Dumper
    • iconOceanBase Deployer
    • iconKubernetes operator for OceanBase
    • iconOceanBase Diagnostic Tool
    • iconOceanBase Binlog Service
    • Connectors and Middleware
    • iconOceanBase Database Proxy
    • iconEmbedded SQL in C for OceanBase
    • iconOceanBase Call Interface
    • iconOceanBase Connector/C
    • iconOceanBase Connector/J
    • iconOceanBase Connector/ODBC
    • iconOceanBase Connector/NET
icon

OceanBase Database

SQL - V4.4.2

    Download PDF

    OceanBase logo

    The Unified Distributed Database for the AI Era.

    Follow Us
    Products
    OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
    Resources
    DocsBlogLive DemosTraining & Certification
    Company
    About OceanBaseTrust CenterLegalPartnerContact Us
    Follow Us

    © OceanBase 2026. All rights reserved

    Cloud Service AgreementPrivacy PolicySecurity
    Contact Us
    Document Feedback
    1. Documentation Center
    2. OceanBase Database
    3. SQL
    4. V4.4.2
    iconOceanBase Database
    SQL - V 4.4.2
    SQL
    KV
    • V 4.4.2
    • V 4.3.5
    • V 4.3.3
    • V 4.3.1
    • V 4.3.0
    • V 4.2.5
    • V 4.2.2
    • V 4.2.1
    • V 4.2.0
    • V 4.1.0
    • V 4.0.0
    • V 3.1.4 and earlier

    TEXT types

    Last Updated:2026-04-02 06:23:57  Updated
    share
    What is on this page
    TINYTEXT
    TEXT
    MEDIUMTEXT
    LONGTEXT

    folded

    share

    TEXT types are used to store text data.

    TEXT types are classified into TINYTEXT, TEXT, MEDIUMTEXT, and LONGTEXT. The four text types correspond to four BLOB types and have the same maximum length and storage requirements.

    The values of the TEXT types are treated as non-binary strings. They have a character set other than binary, and are sorted and compared based on the collation of the character set.

    When strict SQL mode is not enabled, if the value assigned to a TEXT column exceeds the maximum length of the column, the excess part of the value is truncated, and an alert is generated. In strict SQL mode, if non-space characters are truncated, an error instead of an alert occurs, and the insertion of the value is prohibited. When excess trailing spaces in the value inserted into a TEXT column are truncated, an alert is generated, regardless of the SQL mode.

    TINYTEXT

    The maximum length of a TINYTEXT column is 255 bytes.

    The syntax of TINYTEXT is as follows:

    TINYTEXT [CHARACTER SET charset_name] [COLLATE collation_name]
    

    The CHARACTER SET attribute specifies the character set. If necessary, you can use COLLATE and other attributes to specify the collation of the character set. If CHARACTER SET specifies the binary character set, the column is created as a binary string column, and the TEXT type changes to the BLOB type.

    TEXT

    The maximum length of a TEXT column is 65,535 bytes.

    You can specify an optional length M for the TEXT type. The syntax is as follows:

    TEXT[(M)] [CHARACTER SET charset_name] [COLLATE collation_name]
    

    The CHARACTER SET attribute specifies the character set. If necessary, you can use COLLATE and other attributes to specify the collation of the character set. If CHARACTER SET specifies the binary character set, the column is created as a binary string column, and the TEXT type changes to the BLOB type.

    MEDIUMTEXT

    The maximum length of a MEDIUMTEXT column is 16,777,215 bytes.

    The syntax of MEDIUMTEXT is as follows:

    MEDIUMTEXT [CHARACTER SET charset_name] [COLLATE collation_name]
    

    The CHARACTER SET attribute specifies the character set. If necessary, you can use COLLATE and other attributes to specify the collation of the character set. If CHARACTER SET specifies the binary character set, the column is created as a binary string column, and the TEXT type changes to the BLOB type.

    In addition, OceanBase Database supports the extended LONG type, but we recommend that you use MEDIUMTEXT.

    LONGTEXT

    The maximum length of a LONGTEXT column is 536,870,910 bytes. The maximum valid length of a LONGTEXT column also depends on the maximum packet size and available memory configured in the client/server protocol.

    The syntax of LONGTEXT is as follows:

    LONGTEXT [CHARACTER SET charset_name] [COLLATE collation_name]
    

    The CHARACTER SET attribute specifies the character set. If necessary, you can use COLLATE and other attributes to specify the collation of the character set. If CHARACTER SET specifies the binary character set, the column is created as a binary string column, and the TEXT type changes to the BLOB type.

    Previous topic

    BLOB types
    Last

    Next topic

    STRING types
    Next
    What is on this page
    TINYTEXT
    TEXT
    MEDIUMTEXT
    LONGTEXT