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 Developer Center

V3.2.0Enterprise Edition

  • OceanBase Developer Center Documentation
  • What's New
    • Product updates
  • Overview
    • What is ODC?
    • Benefits
    • Architecture
    • Features
    • Limits
  • Quick Start
    • Overview
    • Install ODC
    • Log on to ODC with an account
  • Tutorials
    • Tips on the SQL Console
    • Create a connection
    • Export data
    • Import data
    • Debug a stored procedure
    • View the performance of an SQL statement
  • User Guide (Web ODC)
    • ODC homepage
    • Recycle bin
    • Session management
    • Help Center
    • Database objects
      • Type objects
        • Overview
        • Create a type
        • Manage types
      • Table objects
        • Overview
        • Create a table
        • Table list
        • Manage table attributes
        • Manage table data
      • Function objects
        • Overview
        • Create a function
        • Manage functions
      • Stored procedure objects
        • Overview
        • Create a stored procedure
        • Manage stored procedures
      • View objects
        • Overview
        • Create a view
        • Manage views
      • Synonym objects
        • Overview
        • Create a synonym
        • Manage synonyms
      • Trigger objects
        • Overview
        • Create a trigger
        • Manage triggers
      • Sequence objects
        • Overview
        • Create a sequence
        • Manage sequences
      • Package objects
        • Overview
        • Create a package
        • Manage program packages
    • Public resource management
      • Overview
      • System settings
      • Resource management
        • Manage public connections
        • Manage resource groups
      • Member management
        • Manage users
        • Manage roles
    • Use the workspace
      • Overview
      • SQL window
      • Anonymous block window
      • Command-line window
      • Stored scripts
      • Snippets
    • Log on to ODC
      • Log on to ODC with an account
      • Change password
    • Use tools
      • Data mocking
      • Asynchronous execution
      • Data export and import
        • Overview
        • Export and import formats
        • Batch export and import
        • Single table export and import
    • Task management
      • Overview
      • Import tasks
      • Export tasks
      • Data mocking tasks
      • Asynchronous tasks
    • Connect to a database
      • Manage connections
  • User Guide (Client ODC)
    • Install ODC
    • ODC homepage
    • Recycle bin
    • Session management
    • Help center
    • Connect to a database
      • Create a connection
      • Manage connections
    • Use the workspace
      • Overview
      • SQL window
      • Anonymous block window
      • Command-line window
      • Stored scripts
      • Snippets
    • Database objects
      • Table objects
        • Overview
        • Create a table
        • Table list
        • Manage table attributes
        • Manage table data
      • View objects
        • Overview
        • Create a view
        • Manage views
      • Function objects
        • Overview
        • Create a function
        • Manage functions
      • Stored procedure objects
        • Overview
        • Create a stored procedure
        • Manage stored procedures
      • Sequence objects
        • Overview
        • Create a sequence
        • Manage sequences
      • Package objects
        • Overview
        • Create a package
        • Manage program packages
      • Trigger objects
        • Overview
        • Create a trigger
        • Manage triggers
      • Type objects
        • Overview
        • Create a type
        • Manage types
      • Synonym objects
        • Overview
        • Create a synonym
        • Manage synonyms
    • Task management
      • Overview
      • Import tasks
      • Export tasks
      • Data mocking tasks
      • Asynchronous tasks
    • Use tools
      • Data mocking
      • Asynchronous execution
      • Data export and import
        • Overview
        • Export and import formats
        • Batch export and import
        • Single table export and import
  • Deployment Guide
    • Deployment overview
    • Preparations before deployment
    • Deployment verification
    • Deploy a single ODC node
      • Deployment process
      • Load and run an ODC image
    • Deploy ODC in high availability mode
      • Deployment process
      • Load and run an ODC image
      • Deploy SSL certificate
      • Deploy the NGINX proxy
      • Configure certificate trust
  • Upgrade Guide
    • Overview
    • Preparation for upgrade
    • Upgrade verification
    • Rollback after upgrade failed
    • Upgrade high-availability
      • Upgrade process
      • Stop ODC of the earlier version
      • Load and run an ODC image
      • Upgrade NGINX image
    • Upgrade single-node ODC
      • Upgrade process
      • Stop ODC of the earlier version
      • Load and run an ODC image
  • FAQ

Download PDF

OceanBase Developer Center Documentation Product updates What is ODC? Benefits Architecture Features Limits Overview Install ODC Log on to ODC with an account Tips on the SQL Console Create a connection Export data Import data Debug a stored procedure View the performance of an SQL statement ODC homepage Recycle bin Session management Help Center Overview System settings Overview SQL window Anonymous block window Command-line window Stored scripts Snippets Log on to ODC with an account Change password Data mocking Asynchronous execution Overview Import tasks Export tasks Data mocking tasks Asynchronous tasks Manage connections Install ODC ODC homepage Recycle bin Session management Help center Create a connection Manage connections Overview SQL window Anonymous block window Command-line window Stored scripts Snippets Overview Import tasks Export tasks Data mocking tasks Asynchronous tasks Data mocking Asynchronous execution Deployment overview Preparations before deployment Deployment verification Deployment process Load and run an ODC image Deployment process Load and run an ODC image Deploy SSL certificate Deploy the NGINX proxy Configure certificate trust Overview Preparation for upgrade Upgrade verification Rollback after upgrade failed Upgrade process Stop ODC of the earlier version Load and run an ODC image Upgrade NGINX image Upgrade process Stop ODC of the earlier version Load and run an ODC image FAQ
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 Developer Center
  3. V3.2.0
iconOceanBase Developer Center
V 3.2.0Enterprise Edition
  • V 4.4.2
  • V 4.4.1
  • V 4.4.0
  • V 4.3.4
  • V 4.3.3
  • V 4.3.2
  • V 4.3.1
  • V 4.3.0
  • V 4.2.4
  • V 4.2.3
  • V 4.2.2
  • V 4.2.1
  • V 4.2.0
  • V 4.1.3 and earlier

Snippets

Last Updated:2023-06-25 03:26:45  Updated
share
What is on this page
View snippets
Create a snippet
Reference a snippet
Manage snippets

folded

share

As an enterprise-class database development platform, OceanBase Developer Center (ODC) provides the snippets module to facilitate database development. If you forget about the usage of some statements, you can query in the snippets module. The snippets module provides suitable snippets based on whether you are in Oracle or MySQL mode. In addition to the built-in snippets, you can also create custom snippets to store frequently used code segments. A custom snippet can be viewed only by its creator.

To open the Snippets panel, click Snippets in the toolbar of an SQL window, an anonymous block window, or a PL object editing page.

Image 516

View snippets

In the Snippets panel, the snippets are displayed in a list of cards. Each card displays information about a snippet, such as its name, description, and type. When you place the pointer over the tips icon next to a snippet name, a tip window appears, displaying the entire code in the snippet.

You can find a search box above the card list. You can directly search for specific snippets. A filter is provided below the search box for you to filter snippets by type. The filter provides the following options: Others , DML , DDL , Process Control Statement , and All Types . By default, All Types is selected.

Create a snippet

Click the +Create button in the upper-right corner of the snippet list. The Create Snippet panel appears. Specify the following information in the panel:

  • Snippet Name : specifies the name of the snippet. It can contain letters, digits, and underscores (_), and can contain a maximum of 60 characters. This parameter must be specified.

  • Snippet Type : specifies the type of the snippet. The types include Others , DML , DDL , and Process Control Statement . By default, Others is selected.

  • Snippet : specifies the actual code of the snippet. The length cannot exceed 200 characters. This parameter must be specified. Similar to the SQL window, the toolbar of the editing area also provides buttons such as Format, Find and Replace, Undo, Redo, Case Sensitivity, Indent, and Comment. It also provides code highlighting and association features.

  • Snippet Description : provides additional notes on the snippet. The length cannot exceed 200 characters. This parameter must be specified.

Image 517

Reference a snippet

You not only can view the content of a created snippet when you edit scripts, but also can reference it in your script. You can reference a snippet by using one of the following three methods:

  • Method 1: Drag the target card from the snippet list to the editing area, and the code in the snippet is copied to the editing area.

  • Method 2: Click the copy icon in the lower-right corner of the target snippet card to copy the code, and then press Ctrl+V or Cmd+V to paste the code to the editing area.

  • Method 3: The editing area of the SQL window supports code association. When you edit a script in the editing area, existing snippets appear in the code association window for you to view and reference.

Manage snippets

ODC provides the Edit and Delete options for you to manage custom snippets. You cannot edit or delete built-in snippets.

  • Edit : Click the management icon (···) in the upper-right corner of the target snippet card. In the menu that appears, click the Edit button to go to the Edit Snippet panel. The panel displays parameters such as Snippet Name , Snippet Type , Snippets , and Snippet Description that were specified at creation of the snippet. You can modify the information as needed.

  • Delete : Click the management icon (···) in the upper-right corner of the target snippet card. In the menu that appears, click the Delete button to delete the snippet.

Previous topic

Stored scripts
Last

Next topic

Overview
Next
What is on this page
View snippets
Create a snippet
Reference a snippet
Manage snippets