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 Cloud Platform

V4.0.0Enterprise Edition

    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 Cloud Platform
    3. V4.0.0
    iconOceanBase Cloud Platform
    V 4.0.0Enterprise Edition
    • V 4.3.6
    • V 4.3.5
    • V 4.3.4
    • V 4.3.3
    • V 4.3.2
    • V 4.3.1
    • V 4.3.0
    • V 4.2.2
    • V 4.0.0 and earlier
    Community Edition
    • V 4.0.0
    • V 3.1.1
    Enterprise Edition
    • V 4.0.0
    • V 3.3.1

    Query SQL text

    Last Updated:2023-08-15 02:30:55  Updated
    share
    What is on this page
    Description
    Call description
    Examples

    folded

    share

    Description

    You can call this operation to query complete SQL text of a specified ID.

    Call description

    Prerequisite

    You have the read privilege on the specified tenant.

    Request path

    GET /api/v2/ob/clusters/{clusterId}/tenants/{tenantId}/sql/{sqlId}/text

    Request parameters

    Parameter Type Required Example Description
    clusterId Integer Yes 1 The ID of the cluster.
    tenantId Integer Yes 1001 The ID of the tenant.
    sqlId String Yes C9B3A63AFF8F2A408CCF3D5B0F36682D The ID of the SQL statement.
    startTime Datetime Yes 2020-02-16T05:32:16+08:00 The start time.
    endTime Datetime Yes 2020-02-16T07:32:16+08:00 The end time.

    Response parameters

    Basic data structure

    Parameter Type Description
    data Object The request data.
    ├─ fulltext String The complete SQL text.
    successful Boolean Whether the request is successful.
    timestamp Datetime The timestamp when the server completes the request.
    duration Integer The time that the server takes to process the request, in milliseconds.
    status Integer The encoding in compliance with the HTTP Status specification.
    traceId String The trace ID of the request. This trace ID is used for troubleshooting.
    server String The address of the application server that responds to the request.

    Examples

    Sample request

    Query the SQL text whose ID is C9B3A63AFF8F2A408CCF3D5B0F36682D based on the cluster ID 1 and tenant ID 1001, and set the time range to 2020-11-03T19:00:00+08:00 to 2020-11-03T20:00.

    GET /api/v2/ob/clusters/1/tenants/1001/C9B3A63AFF8F2A408CCF3D5B0F36682D/text?startTime=2020-11-03T19%3A00%3A00%2B08%3A00&endTime=2020-11-03T20%3A00%3A00%2B08%3A00
    

    Sample response

    {
        "duration": 23,
        "server": "192.168.100.1",
        "status": 200,
        "successful": true,
        "timestamp": "2020-11-03T21:14:53.216+08:00",
        "traceId": "60ff4f60c1e6454d",
        "data": {
            "fulltext": "SELECT 1 FROM DUAL"
        }   
    }
    

    Previous topic

    Query the performance indicator trend of an SQL statement
    Last

    Next topic

    Query performance indicators of an execution plan
    Next
    What is on this page
    Description
    Call description
    Examples