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

Embedded SQL in C for OceanBase

V1.1.7Enterprise Edition

  • What's New
  • What is ECOB?
  • ECOB compatibility with Pro*C
  • Install ECOB
  • Data types and variables
    • Overview
    • Supported data types
    • Data type conversion
    • Indicator variable
    • VARCHAR variable
    • Structure
    • String pointer
  • Embedded SQL statements
    • Overview
    • Variable declaration
    • Connect to OceanBase databases
    • Basic SQL statements
    • Prepared statements
    • Stored procedures
    • Cursor
    • Simple dynamic SQL statement
    • ANSI dynamic SQL statements
    • Error handling
      • SQLCA structure
      • WHENEVER statement
    • LOB-related SQL statements
  • Use ECOB
    • Environment preparation
    • Use ECOB
    • Compile the Tuxedo service
  • Command Line Options

Download PDF

What's New What is ECOB? ECOB compatibility with Pro*C Install ECOB Overview Supported data types Data type conversion Indicator variable VARCHAR variable Structure String pointer Overview Variable declaration Connect to OceanBase databases Basic SQL statements Prepared statements Stored procedures Cursor Simple dynamic SQL statement ANSI dynamic SQL statements SQLCA structure WHENEVER statement LOB-related SQL statements Environment preparation Use ECOB Compile the Tuxedo service Command Line Options
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. Embedded SQL in C for OceanBase
  3. V1.1.7
iconEmbedded SQL in C for OceanBase
V 1.1.7Enterprise Edition

Overview

Last Updated:2023-06-29 11:12:55  Updated
share
What is on this page
share

#docslug#/ecob/ecob/V1.1.6/overview-1

The embedded SQL statements supported by OceanBase Embedded SQL in C (ECOB) include all standard SQL statements and some extended SQL statements. The extended SQL statements are used between the host application and OBServer to deliver data.

The following code shows the syntax of the embedded SQL statement used by ECOB. Note that EXEC SQL must be added before the statement.

EXEC SQL <standard SQL statement>|<extension SQL statement>

For more information about the syntax of the standard SQL statements, see OceanBase Database SQL Reference (Oracle mode). For more information, see SQL statements. The following table lists extended SQL statements supported by ECOB V1.1.0. The following topics describe the extended SQL statements supported by ECOB and special SQL statements of ECOB.

Type Statement Description
Connection creation CONNECT Creates a connection to an OceanBase Database instance.
Basic SQL statements SELECT Executes a query and assigns the query result to the external host variables.
Basic SQL statements INSERT Executes an insert statement.
Basic SQL statements UPDATE Synchronizes the values of external variables to table columns of OceanBase Database or updates the column where the cursor is located.
Basic SQL statements DELETE Deletes one or more rows of data in OceanBase Database or deletes the column where the cursor is located.
Basic SQL statements COMMIT Commits a transaction. You can specify whether to release resources and disconnect the database connection.
Basic SQL statements ROLLBACK Rolls back a transaction.You can specify whether to release resources and disconnect the database connection.
Basic SQL statement SAVEPOINT Sets a transaction savepoint. After a transaction ends, all savepoints are automatically released.
Prepared statements PREPARE Precompiles an SQL statement in PS mode.
Prepared statements EXECUTE Executes the precompiled SQL statement.
Stored procedures CALL Calls stored procedures.
Cursor DECLARE CURSOR Defines a cursor variable. In ECOB V1.1.0, the cursor variable only supports queries.
Cursor OPEN Opens a cursor variable.
Cursor FETCH Fetches the result set stored by the cursor variable.
Cursor CLOSE Closes a cursor variable.
Cursor ALLOCATE Allocates a cursor variable.
Simple dynamic SQL statement EXECUTE IMMEDIATE Executes a dynamic SQL string.
ANSI dynamic SQL statements ALLOCATE DESCRIPTOR Allocates the SQL description area.
ANSI dynamic SQL statements DEALLOCATE DESCRIPTOR Releases the SQL description area.
ANSI dynamic SQL statements DESCRIBE INPUT DESCRIPTOR Binds variable information.
ANSI dynamic SQL statements DESCRIBE OUTPUT DESCRIPTOR Gets the information of the output column.
ANSI dynamic SQL statements GET DESCRIPTOR Gets the item information of the SQL description area.
ANSI dynamic SQL statements SET DESCRIPTOR Sets the item information of the SQL description area.
ANSI dynamic SQL statements OPEN USING DESCRIPTOR Opens the cursor variable in an ANSI dynamic SQL statement.
ANSI dynamic SQL statements FETCH INTO DESCRIPTOR Uses the dynamic statement descriptor to get the result set stored by the cursor variable.
LOB-related SQL statement ALLOCATE Allocates a LOB locator and initializes it to null.
LOB-related SQL statement DESCRIBE Describes the attributes of an LOB.
LOB-related SQL statement WRITE Writes the content of a buffer to a LOB.
LOB-related SQL statement READ Reads all or part of the content in a LOB or BFILE to the buffer.
LOB-related SQL statement VAR Performs host variable equivalencing, or allocates a specific external data type to a single host variable to override the default data type.
LOB-related SQL statement TYPE Performs user-defined type equivalencing, or makes an external data type equivalent to a user-defined data type to allocate the external data type to the entire host variable class.
LOB-related SQL statement FREE Releases the memory reserved by the ALLOCATE statement.

Previous topic

String pointer
Last

Next topic

Variable declaration
Next