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.3.3

    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.3.3
    iconOceanBase Database
    SQL - V 4.3.3
    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

    PARSE

    Last Updated:2024-12-02 03:48:27  Updated
    share
    What is on this page
    Syntax
    Parameters
    Considerations
    Exceptions

    folded

    share

    The PARSE stored procedure parses a DML statement (including SELECT). It also executes other statements such as DDL statements or system commands.

    The following versions of PARSE subprograms are available:

    • One version supports VARCHAR2 arguments.

    • Another version supports VARCHAR2A or VARCHAR2S arguments. For example, the PARSE stored procedure may concatenate segmented strings from an array to form an SQL statement and parse the result.

      Applicability

      This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only the MySQL mode.

    Syntax

    DBMS_SQL.PARSE(cursor_id       IN INTEGER,
    sql_stmt      IN VARCHAR2,
    language_flag   IN INTEGER);
    
    DBMS_SQL.PARSE(cursor_id       IN INTEGER,
    sql_stmt      IN VARCHAR2A,
    lb            IN INTEGER,
    ub            IN INTEGER,
    lfflg         IN BOOLEAN,
    language_flag   IN INTEGER);
    
    DBMS_SQL.PARSE(cursor_id       IN INTEGER,
    sql_stmt      IN VARCHAR2s,
    lb            IN INTEGER,
    ub            IN INTEGER,
    lfflg         IN BOOLEAN,
    language_flag   IN INTEGER);
    

    Parameters

    Parameter Description
    cursor_id The ID of the cursor used to parse the statement or array.
    sql_stmt The SQL statement or array to parse.
    lb The lower bound of the array index.
    ub The upper bound of the array index.
    lfflg If this parameter is set to TRUE, a line break is inserted after every element on concatenation.
    language_flag Specifies the behavior for the SQL statement.

    Considerations

    • Using DBMS_SQL to dynamically run DDL statements can cause the program to be unresponsive. For example, calling a subprogram in a package may cause the package to be locked until the execution returns to the user side. Any operation that causes a conflicting lock, such as attempting to drop the package before the first lock is released, will stop the program from running.

    • Code on the client side cannot reference the variables or constants in a remote package. Therefore, you must explicitly use the value of the constants. For example, the following code cannot be compiled on the client:

      DBMS_SQL.PARSE(cur_hdl,stmt_str,DBMS_SQL.NATIVE);
      -- This code uses the DBMS_SQL.NATIVE constant.
      

    The following code works on the client, because the argument is explicitly provided:

    DBMS_SQL.PARSE(cur_hdl,stmt_str,1);
    -- This code compiles on the client.
    

    Exceptions

    If you create a type, procedure, function, or package by using DBMS_SQL that has compilation warnings, the PL unit will be created, but an exception is raised.

    Previous topic

    OPEN_CURSOR
    Last

    Next topic

    Overview
    Next
    What is on this page
    Syntax
    Parameters
    Considerations
    Exceptions