OceanBase logo

OceanBase

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

Product Overview
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

OceanBase

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

Product Overview
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 & CertificationTicket
    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
    Databases
    • OceanBase Database
    • OceanBase Cloud
    • OceanBase Tugraph
    • Interactive Tutorials
    • OceanBase Best Practices
    Tools
    • OceanBase Cloud Platform
    • OceanBase Migration Service
    • OceanBase Developer Center
    • OceanBase Migration Assessment
    • OceanBase Admin Tool
    • OceanBase Loader and Dumper
    • OceanBase Deployer
    • Kubernetes operator for OceanBase
    • OceanBase Diagnostic Tool
    • OceanBase Binlog Service
    Connectors and Middleware
    • OceanBase Database Proxy
    • Embedded SQL in C for OceanBase
    • OceanBase Call Interface
    • OceanBase Connector/C
    • OceanBase Connector/J
    • OceanBase Connector/ODBC
    • OceanBase Connector/NET
    SQL
    KV
    • V 4.6.0
    • 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

    Multi-model data types

    Last Updated:2026-04-02 06:23:56  Updated
    Share
    What is on this page
    Characteristics of multi-model data
    Query and computing of multi-model data
    Storage of multi-model data
    Multi-model data interchange
    JSON, XML, and GIS data types
    JSON data types
    XML data types
    Spatial data types

    folded

    Share

    In OceanBase Database, semi-structured data types such as JavaScript Object Notation (JSON), geographic information system (GIS), and XML are classified as multi-model data types.

    Characteristics of multi-model data

    • Standard composition: For example, RFC 8259 is a data interchange specification for JavaScript Object Notation (JSON), while Open Geospatial Consortium (OGC) provides a set of text markup language (WKT-CRS) to describe coordinate systems and inter-system conversions, and World Wide Web Consortium (W3C) defines Extensible Markup Language (XML).
    • Direct access based on SQL: As semi-structured data, multi-model data uses basic internal data types that can be mapped to SQL types. Multi-model data adopts a cascading logical tree schema that organizes a series of basic SQL types into complex composite data types.
    • Fixed computing functions: Multi-model data types adopt standardized formats, which not only define the data exchange formats but also contribute to the computing APIs.

    Query and computing of multi-model data

    Multi-model data features a flexible structure. OceanBase Database provides a wide range of functions to support the construction, query, and computing of multi-model data based on the standards of multi-model data.

    • Data construction: OceanBase Database provides aggregation functions that extract basic data from relational tables based on certain aggregation rules to construct JSON and XML objects.
    • Data query: For JSON and XML data, OceanBase Database allows you to access a subset of multi-model data objects or a specific basic SQL element based on paths.
    • Data computing: OceanBase Database allows you to use GIS functions to compute the relationships between spatial objects.

    Storage of multi-model data

    As a type of composite data, multi-model data is generally at a variable length, and a multi-model data object can sometimes be quite large. For storage convenience, multi-model data generally inherits the storage characteristics of LOB data. Technically, the storage upper limit of LOB data also applies to multi-model data. However, as the computing and storage of a large multi-model data object is very inefficient, we recommend that you do not construct a large multi-model data object.

    • CLOB or VARCHAR2 type: You can store multi-model data directly as the CLOB or VARCHAR2 type in the database based on the standard text format. The disadvantage of this method is that each query of multi-model data requires parsing. Therefore, we recommend that you do not use this method to store multi-model data.
    • Native multi-model type: The format of the stored data is optimized for database parsing. Once multi-model data is stored in the database, it will not be parsed again in the next query, and the storage space is also optimized. We recommend that you use the native multi-model type for storage.

    Multi-model data interchange

    Multi-model data is interchanged between different systems based on the standard format specifications.

    Notice

    In Oracle-compatible mode, a JSON-based virtual generation function can create a secondary index on an element within any JSON object.

    JSON, XML, and GIS data types

    JSON data types

    OceanBase Database supports the JSON data type that complies with ECMA-404 and IETF RFC 8259. According to the JSON standard, JSON values can be objects, arrays, numbers, strings, Boolean values (true or false), or NULL, which are all JSON data types. All values except objects and arrays are scalar values.

    In JSON data types, each attribute name and string value must be enclosed in double quotation marks (").

    A JSON string consists of Unicode characters escaped with backslashes (\). JSON numbers are expressed in decimal notation. Object attributes are usually called fields, and name-value pairs of objects are usually called object members, but members sometimes may represent only attributes. Elements of a JSON array are enclosed in brackets ([ ]). Each element is an object, array, or scalar value. Multiple elements are separated with commas (,), and the elements are sorted in order.

    For more information about JSON data types, see Overview of JSON data types.

    XML data types

    XMLType is an XML data type in SQL. As an abstract data type, XMLType supports XMLType constructors and PL methods for various XML operations.

    You can use XMLType as other SQL data types. For example, you can create an XMLType table or view. In a PL stored procedure, you can use XMLType data as parameters, return values, and variables.

    For more information about XML data types, see Overview of XML data types.

    Spatial data types

    Spatial data types are used to store and process geospatial data. The Oracle-compatible mode of OceanBase Database supports the SDO_GEOMETRY spatial data type. SDO_GEOMETRY is used to store and process geometric data. It is a composite data type used to represent a two-dimensional or three-dimensional geometric figure.

    The current version of OceanBase Database's Oracle-compatible mode supports only the following spatial object types defined by OpenGIS Consortium (OGC): Point, Linestring, Polygon, Multipoint, Multilinestring, Multipolygon, and Collection. Such a spatial object consists of a group of concatenated sequences of points. Both two-dimensional data and three-dimensional data are supported.

    Notice

    The current version of OceanBase Database does not support concatenating points by using arcs.

    For more information about spatial data types, see Overview of spatial data types.

    Previous topic

    Datetime format models
    Last

    Next topic

    Integrity constraints
    Next
    What is on this page
    Characteristics of multi-model data
    Query and computing of multi-model data
    Storage of multi-model data
    Multi-model data interchange
    JSON, XML, and GIS data types
    JSON data types
    XML data types
    Spatial data types