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

V4.4.0

  • Topics Overview
  • Overview
    • What is ODC?
    • Features
    • Architecture
    • Limitations
    • ODC console
  • Quick Start
    • Client ODC
      • Overview
      • Install Client ODC
      • Use Client ODC
    • Web ODC
      • Overview
      • Deploy Web ODC
      • Use Web ODC
  • Data Source Management
    • Create a data source
    • Data sources and project collaboration
    • Database O&M
      • Session management
      • Global variable management
      • Recycle bin management
  • SQL Development
    • Edit and execute SQL statements
    • Perform PL compilation and debugging
    • Use the command-line window
    • Edit and export the result set of an SQL statement
    • Execution analysis
    • Generate test data
    • System settings
    • Database objects
      • Table objects
        • Overview
        • Create a table
      • View objects
        • Overview
        • Create a view
        • Manage views
      • Materialized view objects
        • Overview
        • Create a materialized view
        • Manage materialized 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 program 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
  • Import and Export
    • Import schemas and data
    • Export schemas and data
  • Database Change Management
    • Manage user permissions
      • Users and roles
      • Automatic authorization
      • User permission management
    • Project collaboration management
    • Risk levels, risk identification rules, and approval processes
    • SQL check specifications
    • SQL window specification
    • Database change management
    • Manage changes to logical databases
    • Batch database change management
    • Online schema changes
    • Synchronize shadow tables
    • Schema comparison
  • Data Lifecycle Management
    • Data archiving
    • Data cleanup
    • Manage partitioning plans
      • Manage partitioning plans
      • Set partitioning strategies
      • Examples of partitioning strategies
    • SQL plan task
  • Data Masking and Auditing
    • Desensitize data
    • Operation records
  • Notification Management
    • Overview
    • View notification records
    • Manage notification channels
      • Create a notification channel
      • View, edit, and delete a notification channel
      • Configure a custom channel
    • Manage notification rules
  • System Integration
    • Login integration
    • Approval integration
    • SQL approval integration
    • Bastion host integration
  • Deployment Guide
    • Deployment overview
    • Preparations before deployment
    • Deploy ODC in single-node mode
    • Deploy ODC in high-availability mode
    • Deployment verification
  • Upgrade Guide
    • Upgrade Overview
    • Preparations before upgrade
    • Update single-node ODC
    • Update high-avaliability ODC
    • Upgrade verification
    • Rollback after upgrade failed
  • Best Practices
    • Tips for SQL development
    • Explore ODC team workspaces
    • Understanding real-time SQL diagnostics for OceanBase AP
    • OceanBase historical database solutions
    • ODC SQL check for automatic identification of high-risk operations
    • Integration with ODC enterprise-level account system
    • Manage and modify sharded databases and tables via ODC
    • Data masking and control practices
    • Enterprise-level control and collaboration: Safeguard every database change
  • Troubleshooting
    • ODC troubleshooting process
    • Collect message
      • View the runtime environment and version information
      • View web ODC logs
      • View client ODC logs
      • View end-to-end ODC-related logs
      • View ODC MetaDB data
      • Query the index status in OceanBase Database V4.x
      • Query the index status in OceanBase Database V1.4.x to V3.2.x
      • Collect JVM runtime information
      • Use tcpdump to capture packets
    • FAQ
      • Installation of client ODC
      • Web ODC deployment and startup
      • Connection Information
      • Command-line window
      • DDL statement display
  • Common features
  • Release Notes
    • V4.4
      • ODC V4.4.0
    • V4.3
      • ODC V4.3.4
      • ODC V4.3.3
      • ODC V4.3.2
      • ODC V4.3.1
      • ODC V4.3.0
    • V4.2
      • ODC V4.2.4
      • ODC V4.2.3
      • ODC V4.2.2
      • ODC V4.2.1
      • ODC V4.2.0
    • V4.1
      • ODC V4.1.3
      • ODC V4.1.2
      • ODC V4.1.1
      • ODC V4.1.0
    • V4.0
      • ODC V4.0.2
      • ODC V4.0.0
    • V3.4
      • ODC V3.4.0
    • V3.3
      • ODC V3.3.3
      • ODC V3.3.2
      • ODC V3.3.1
      • ODC V3.3.0
    • V3.2
      • ODC V3.2.3
      • ODC V3.2.2
      • ODC V3.2.1
      • ODC V3.2.0

Download PDF

Topics Overview What is ODC? Features Architecture Limitations ODC console Overview Install Client ODC Use Client ODC Overview Deploy Web ODC Use Web ODC Create a data source Data sources and project collaboration Session management Global variable management Recycle bin management Edit and execute SQL statements Perform PL compilation and debugging Use the command-line window Edit and export the result set of an SQL statement Execution analysis Generate test data System settings Import schemas and data Export schemas and data Users and roles Automatic authorization User permission management Project collaboration management Risk levels, risk identification rules, and approval processes SQL check specifications SQL window specification Database change management Manage changes to logical databases Batch database change management Online schema changes Synchronize shadow tables Schema comparison Data archiving Data cleanup Manage partitioning plans Set partitioning strategies Examples of partitioning strategies SQL plan task Desensitize data Operation records Overview View notification records Create a notification channel View, edit, and delete a notification channel Configure a custom channel Manage notification rules Login integration Approval integration SQL approval integration Bastion host integration Deployment overview Preparations before deployment Deploy ODC in single-node mode Deploy ODC in high-availability mode Deployment verification Upgrade Overview Preparations before upgrade Update single-node ODC Update high-avaliability ODC Upgrade verification Rollback after upgrade failed Tips for SQL development Explore ODC team workspaces Understanding real-time SQL diagnostics for OceanBase AP OceanBase historical database solutions ODC SQL check for automatic identification of high-risk operations Integration with ODC enterprise-level account system Manage and modify sharded databases and tables via ODC Data masking and control practices Enterprise-level control and collaboration: Safeguard every database change ODC troubleshooting process View the runtime environment and version information View web ODC logs View client ODC logs View end-to-end ODC-related logs View ODC MetaDB data Query the index status in OceanBase Database V4.x Query the index status in OceanBase Database V1.4.x to V3.2.x Collect JVM runtime information Use tcpdump to capture packets Installation of client ODC Web ODC deployment and startup Connection Information Command-line window DDL statement display Common features ODC V4.4.0 ODC V4.3.4 ODC V4.3.3 ODC V4.3.2 ODC V4.3.1 ODC V4.3.0 ODC V4.2.4
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. V4.4.0
iconOceanBase Developer Center
V 4.4.0
  • 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

Tips for SQL development

Last Updated:2026-04-07 10:00:35  Updated
share
What is on this page
Background information
Quickly reuse SQL statements
Reuse built-in snippets
Reuse custom snippets
Quickly reuse SQL window content
Manage script files
Execute script files
Quickly view object DDL in SQL window
Manage result sets
Pin result set tabs
Useful features in the result set toolbar
Handle result set content
Quickly create a ticket
Drag and drop to generate SQL statements
Quickly search for objects
Customize your development environment
Customize editor styles
Restrict user behavior within a workspace

folded

share

This topic introduces some common tips for SQL development and operations in ODC.

Background information

OceanBase Developer Center (ODC) is an open-source, enterprise-grade collaborative database development tool designed to improve the security, efficiency, and teamwork of SQL development. As a core component of the OceanBase ecosystem, ODC supports multiple data sources (such as OceanBase, MySQL, and Oracle) and provides full lifecycle management, from SQL writing and execution to change management. ODC also offers many convenient features to support database development and maintenance.

Quickly reuse SQL statements

Reuse built-in snippets

ODC comes with over 30 built-in code snippets. By typing keywords like query_, create_, or stats_ in the SQL window, you can easily access relevant snippets. Selecting a snippet will automatically insert the corresponding SQL template into the editor. These built-in snippets cover common tasks such as checking table data sizes, viewing available cluster resources, creating tenant resource pools, and more.

Built-in snippets

Reuse custom snippets

In addition to built-in snippets, you can also create and reuse your own custom snippets. Navigate to the snippet management page to create a snippet. Once saved, custom snippets can be accessed just like built-in snippets by typing matching keywords in the SQL window.

Custom snippets

Quickly reuse SQL window content

Manage script files

When developing SQL, you often need to share your work or reuse it in different environments. Manually copying and pasting across multiple windows can be time-consuming and error-prone. To solve this, ODC provides script management features that allow you to save SQL window content as script files, and supports batch download and import of scripts for easy reuse.

Script file management

Execute script files

Saved scripts can be executed by double-clicking the script name to open it in a SQL window, or directly from the command line. Right-click the target script, select Copy Path, and then use the source command in the command-line window to execute it.

Execute script files

Quickly view object DDL in SQL window

While writing SQL, you often need to quickly check the DDL of a database object. Instead of navigating through a lengthy path to the object details, starting from ODC V4.3.4, you can simply hover over the object name to view its DDL directly.

View object DDL

Manage result sets

ODC offers a wide range of result set management features. This section highlights some lesser-known but very useful features.

Pin result set tabs

If you want to compare multiple executions of the same SQL, you can hover over a result tab to preview the SQL statement associated with it. Right-click the tab to pin it. A pinned result set will not be overwritten by subsequent query executions.

Pin result set tabs

Useful features in the result set toolbar

The result set toolbar provides options for editing, downloading, real-time analysis, searching, column filtering, and column view modes. In particular, the Real-Time Analysis feature is very helpful for diagnosing SQL issues. See Understanding real-time SQL diagnostics for OceanBase AP for details.

Here is a quick look at two features:

  • Column filtering: Hide unnecessary columns from the query result.

    Column filtering

  • Column mode: Switch to column view to easily review data when there are many columns.

    Column mode

Handle result set content

  • Copy column names

    Double-click a column name to quickly copy it.

    Copy column names

  • View column properties

    Select a column to view its comments, field type, and other details in the status bar.

    View column properties

Export selected results

If you need to export specific rows, columns, or cells, select the desired content, right-click, and choose Export to Clipboard. You can then paste the content as SQL or CSV format into your target document.

Export selected results

Compare rows

Use the Freeze this row feature to lock a reference row and scroll to compare different rows side-by-side.

Compare rows

Select multiple rows and columns

  • Use the Shift key to select a continuous block of rows or columns.
  • Use the Command/Ctrl key to select non-continuous rows or columns.

Select multiple rows and columns

View images in the result set

If the result set contains large objects (LOBs), ODC provides a LOB viewer that allows you to view images directly.

View images in result set

Set the date format for query results

Instead of manually setting the date format every time with SET SESSION nls_date_format='YYYY-MM-DD';, you can configure a default date format at the data source level. Edit the data source settings and adjust the Startup Script.

Set date format

Convert selected column values into WHERE conditions

If you want to perform a secondary query or data correction based on query results, ODC provides a handy feature to convert selected column values into an IN clause format, saving you from manually quoting and separating values.

Convert values into WHERE

Quickly create a ticket

During SQL development, you may often need to initiate tasks such as database changes or data imports/exports. Tickets can be created via:

  • The Ticket module.
  • The Project module under ticket subcategories.
  • The Workspace, using the recently used databases section.
  • The SQL Console, under the ticket section.

Additionally, you can initiate a ticket directly from the resource tree. For example, if you are working on the legend database and need to submit a change, simply locate the database in the resource tree, right-click it, and start a ticket.

Quickly create a ticket

Drag and drop to generate SQL statements

To quickly generate a query for a table, simply drag the table from the resource tree into the SQL window. A SELECT statement for the table will be automatically generated.

Drag and drop SQL

By default, dragging inserts only the table name. You can customize the drag-and-drop behavior in your user settings.

Customize drag behavior

Quickly search for objects

During SQL development, you often need to switch databases or locate specific objects. You can use ODC's global search feature by clicking the search button to bring up the search window. It supports search by project, data source, and database dimensions.

Global search

Depending on the search result:

  • Project: Locates the project in the resource tree.
  • Data source: Locates the data source in the resource tree.
  • Database: Locates the database in the resource tree and opens a SQL window for it.
  • Database object (such as a table): Locates the object and opens its DDL tab.

Customize your development environment

Every developer has their own preferences. ODC allows you to configure personal preferences and workspace-level constraints through the settings center.

Notice

Workspace-level configurations require workspace admin privileges.

Customize editor styles

At the user level, you can configure session commit modes, result set and SQL execution behaviors, editor themes, font sizes, and shortcut key mappings.

Customize editor styles

Restrict user behavior within a workspace

You can impose constraints on certain features to maintain workspace stability. For example, you can:

  • Set a Query Row Limit to restrict the number of rows returned by any SQL query.
  • Allow or restrict Schema Replacement during Import Tickets based on your workspace needs.

Previous topic

Rollback after upgrade failed
Last

Next topic

Explore ODC team workspaces
Next
What is on this page
Background information
Quickly reuse SQL statements
Reuse built-in snippets
Reuse custom snippets
Quickly reuse SQL window content
Manage script files
Execute script files
Quickly view object DDL in SQL window
Manage result sets
Pin result set tabs
Useful features in the result set toolbar
Handle result set content
Quickly create a ticket
Drag and drop to generate SQL statements
Quickly search for objects
Customize your development environment
Customize editor styles
Restrict user behavior within a workspace