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 Call Interface

V2.1.0Enterprise Edition

  • What's New
  • Product Introduction
  • Install OBCI
  • Data types
  • Basic development procedure
  • Development example
  • Load balancing
  • Reference Functions
    • Connect, authorize, and initialize functions
    • Handle and descriptor functions
    • Bind, define, and describe functions
    • Statement functions
    • LOB functions
    • Transaction functions
    • Miscellaneous functions
    • String functions
    • Date and Datetime functions
    • Interval functions
    • Number functions
    • Terminate functions
    • Describe functions
    • Locale functions
    • Define functions
  • Full-link Diagnostic Trace
    • Full-link Diagnostic Trace
    • Full-link Diagnostic Trace of OBCI
    • Sample code

Download PDF

What's New Product Introduction Install OBCI Data types Basic development procedure Development example Load balancing Connect, authorize, and initialize functions Handle and descriptor functions Bind, define, and describe functions Statement functions LOB functions Transaction functions Miscellaneous functions String functions Date and Datetime functions Interval functions Number functions Terminate functions Describe functions Locale functions Define functions Full-link Diagnostic Trace Full-link Diagnostic Trace of OBCI Sample code
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 Call Interface
  3. V2.1.0
iconOceanBase Call Interface
V 2.1.0Enterprise Edition

Define functions

Last Updated:2024-05-14 09:02:08  Updated
share
What is on this page
OCIDefineDynamic

folded

share

OCIDefineDynamic

Purpose : You can call this function to set the additional attributes required when the OCI_DYNAMIC_FETCH mode is selected in the OCIDefineByPos() or OCIDefineByPos2() function.

Syntax :

sword OCIDefineDynamic ( OCIDefine   *defnp,
                         OCIError    *errhp,
                         void        *octxp, 
                         OCICallbackDefine      (ocbfp)(
                                  void          *octxp,
                                  OCIDefine     *defnp,
                                  ub4            iter, 
                                  void         **bufpp,
                                  ub4          **alenpp,
                                  ub1           *piecep,
                                  void         **indpp,
                                  ub2          **rcodep );

Parameters :

Parameter Description
defnp (IN/OUT) The handle to a define structure that is returned when the OCIDefineByPos() function is called.
errhp (IN/OUT) An error handle. When an error occurs, you can pass it to the OCIErrorGet() function to obtain the diagnostic information.
octxp (IN) Points to a context for the callback function.
ocbfp (IN) Points to the callback function. This parameter is called at runtime to obtain a pointer to a buffer. The buffer is used to retrieve the obtained data or a piece of it. The callback also specifies the indicator, return code, and lengths of the data piece and indicator.
Note
Generally, in an Oracle Cloud Infrastructure (OCI) function, an IN parameter refers to the data passed to OCI and an OUT parameter refers to the data returned from OCI. It is the opposite for a callback function, where IN indicates that data is passed from OCI to the callback function, while OUT indicates that data is passed from the callback function to OCI.
octxp (IN/OUT) A parameter of the callback function. It is a context pointer to all the callback functions. When the client library needs a buffer to return the obtained data, the callback function will be used to provide a runtime buffer into which a piece or the whole data will be returned.
defnp (IN) A parameter of the callback function. It specifies the define handle.
iter (IN) A parameter of the callback function. It specifies which row is currently fetched. The parameter is 0-based.
bufpp (OUT) A parameter of the callback function. It returns a pointer to a buffer to store the column values, which means that *bufpp points to some proper storage for the column values.
alenpp (IN/OUT) A parameter of the callback function. The parameter is used by applications to set the size of the storage provided in *bufpp. After the data is fetched to the buffer, alenpp indicates the actual data size in bytes. If the length of the buffer provided in the first call is insufficient to store all the data returned from the server, the callback function is used again, and so forth.
piecep (IN/OUT) A parameter of the callback function. It returns a piece value from a callback (application) to OCI. The piecep parameter indicates whether the piece to be obtained is the first piece (OCI_FIRST_PIECE), a subsequent piece (OCI_NEXT_PIECE), or the last piece (OCI_LAST_PIECE). The application can process the piece in the next callback, or at the end of a series of callbacks.
  • IN: The value can be OCI_ONE_PIECE, OCI_FIRST_PIECE, or OCI_NEXT_PIECE.
  • OUT: The value depends on the value of IN.
    • If the value of IN is OCI_ONE_PIECE, the value of OUT is OCI_ONE_PIECE.
    • If the value of IN is OCI_FIRST_PIECE, the value of OUT is OCI_ONE_PIECE or OCI_FIRST_PIECE.
    • If the value of IN is OCI_NEXT_PIECE, the value of OUT is OCI_NEXT_PIECE or OCI_LAST_PIECE.
indpp (IN) A parameter of the callback function. It is an indicator variable pointer.
rcodep (IN) A parameter of the callback function. It returns a code variable pointer.

Return value : OCI_SUCCESS is returned if the function call succeeded. Otherwise, OCI_ERROR is returned.

Previous topic

Locale functions
Last

Next topic

Full-link Diagnostic Trace
Next
What is on this page
OCIDefineDynamic