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.0.1Enterprise Edition

  • What's New
  • Product Introduction
  • Install OBCI
  • Data Types
  • 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 functions
    • Number functions
  • Developer Guide
    • Basic development procedure
    • Development example

Download PDF

What's New Product Introduction Install OBCI Data Types Connect, authorize, and initialize functionsHandle and descriptor functionsBind, define, and describe functionsStatement functionsLoB functionsTransaction functionsMiscellaneous functionsString functionsDate functionsNumber functionsBasic development procedureDevelopment example
OceanBase logo

The Unified Distributed Database for the AI Era.

Follow Us
Products
OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
Resources
DocsBlogWhite PaperLive DemosTraining & CertificationTicket
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.0.1
iconOceanBase Call Interface
V 2.0.1Enterprise Edition
Databases
  • OceanBase Database
  • OceanBase Cloud
  • OceanBase Tugraph
  • Interactive Tutorials
  • OceanBase Best Practices
Tools
  • OceanBase Cloud Platform
  • OceanBase Migration Service
  • OceanBase Developer Center
  • OceanBase Migration Assessment
  • OceanBase Admin Tool
  • OceanBase Loader and Dumper
  • OceanBase Deployer
  • Kubernetes operator for OceanBase
  • OceanBase Diagnostic Tool
  • OceanBase Binlog Service
Connectors and Middleware
  • OceanBase Database Proxy
  • Embedded SQL in C for OceanBase
  • OceanBase Call Interface
  • OceanBase Connector/C
  • OceanBase Connector/J
  • OceanBase Connector/ODBC
  • OceanBase Connector/NET

Handle and descriptor functions

Last Updated:2023-06-29 06:42:04  Updated
Share
What is on this page
OCIAttrGet
OCIAttrSet
OCIDescriptorAlloc
OCIDescriptorFree
OCIHandleAlloc
OCIHandleFree
OCIParamGet

folded

Share

#docslug#/obci/obci/V2.0.1/vryn9e

OCIAttrGet

Description : You can call this function to obtain an attribute value of a handle.

Function syntax :

sword OCIAttrGet ( CONST dvoid *trgthndlp,
ub4 trghndltyp,
dvoid *attributep,
ub4 *sizep,
ub4 attrtype,
OCIError *errhp );

Parameters :

Parameter
Description
trgthndlp(IN) The pointer to the handle whose attribute value is to be obtained.
trghndltyp(IN) The handle type. For supported handle types, see the handle attribute table in the Description section.
attributep(OUT) The buffer that stores output attributes.
size(OUT) The buffer that stores the size of output attributes.
attrtype(IN) The type of the attribute to be obtained.
errhp(IN) The error handle.

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

Description : The following table describes the handles and their attributes that can be obtained by calling the OCIAttrGet() function.

Handle
Handle description
Attribute
Attribute description
OCI_HTYPE_SVCCTX The context handle. OCI_ATTR_SERVER Returns the pointer to the server context attribute when this attribute is read. Sets the server context attribute when this attribute is modified.
OCI_HTYPE_SVCCTX The context handle. OCI_ATTR_SESSION Returns the pointer to the authentication context attribute when this attribute is read. Sets the authentication context attribute when this attribute is modified.
OCI_HTYPE_SVCCTX The context handle. OCI_ATTR_TRANS Returns the pointer to the transaction context attribute when this attribute is read. Sets the transaction context attribute when this attribute is modified.
OCI_HTYPE_SESSION The session handle. OCI_ATTR_USERNAME The client certificate for proxy authentication.
OCI_HTYPE_STMT The statement handle. OCI_ATTR_ROW_COUNT Returns the number of rows converted after the OCIDirPathColArrayToStream() function is called.
OCI_HTYPE_STMT The statement handle. OCI_ATTR_CURRENT_POSITION The current position in the result set. This attribute can only be retrieved and cannot be configured.
OCI_HTYPE_STMT The statement handle. OCI_ATTR_ROWS_FETCHED The number of rows that were fetched into the user buffers in the last fetch or the number of rows executed in non-zero iterations. This attribute can be used for both scrollable and nonscrollable statement handles.
OCI_HTYPE_STMT The statement handle. OCI_ATTR_PARAM_COUNT Returns the number of parameters in the describe handle.
OCI_HTYPE_STMT The statement handle. OCI_ATTR_NUM_DML_ERRORS Returns the number of errors occurred in the DML operation.
OCI_HTYPE_STMT The statement handle. OCI_ATTR_ROWID Returns the ROWID descriptor allocated to the OCIDescriptorAlloc() function.
OCI_DTYPE_PARAM The parameter descriptor handle. OCI_ATTR_DATA_TYPE Returns or sets the external data type of the column.
OCI_DTYPE_PARAM The parameter descriptor handle. OCI_ATTR_CHAR_SIZE Returns the length of the column, which is the number of characters allowed in the column.
OCI_DTYPE_PARAM The parameter descriptor handle. OCI_ATTR_CHARSET_ID The ID of the character set.
OCI_DTYPE_PARAM The parameter descriptor handle. OCI_ATTR_DATA_SIZE The maximum length of the column. The length is calculated in bytes instead of strings or original characters.
OCI_DTYPE_PARAM The parameter descriptor handle. OCI_ATTR_PRECISION Returns or sets the precision.
OCI_DTYPE_PARAM The parameter descriptor handle. OCI_ATTR_SCALE Returns or sets the number of digits to the right of the decimal point.
OCI_DTYPE_PARAM The parameter descriptor handle. OCI_ATTR_NAME The name of the table to be loaded.
OCI_DTYPE_PARAM The parameter descriptor handle. OCI_ATTR_IS_NULL Returns 0 if the column value cannot be NULL.
OCI_HTYPE_ERROR The error handle. OCI_ATTR_DML_ROW_OFFSET Returns the offset at which the error occurred.
OCI_HTYPE_SERVER The server handle. OCI_ATTR_EXTERNAL_NAME The external name of the database. The external name is a user-friendly global name stored in sys.props$.value$. The name may not be unique unless all databases register their names with the network directory service.
OCI_HTYPE_SERVER The server handle. OCI_ATTR_INTERNAL_NAME The name of the client database that is recorded when a global transaction is executed. Database administrators (DBAs) use the name to track transactions that may be suspended after failed executions.

OCIAttrSet

Description : You can call this function to set an attribute for a handle.

Function syntax :

sword OCIAttrSet ( dvoid *trgthndlp,
ub4 trghndltyp,
dvoid *attributep,
ub4 size,
ub4 attrtype,
OCIError *errhp );

Parameters :

Parameter
Description
trgthndlp(IN) The pointer to the handle whose attribute needs to be set.
trghndltyp(IN) The type of the handle that needs to obtain an attribute. For supported handle types, see the handle attribute table in the Description section.
attributep(IN) The pointer whose attribute needs to be set.
size(IN) The size of the attributep parameter.
attrtype(IN) The type of the attribute that needs to be set.
errhp(IN) The error handle.

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

Description : The following table describes the handles and their attributes that can be set by calling the OCIAttrSet() function.

Handle
Handle description
Attribute
Attribute description
OCI_HTYPE_SVCCTX The context handle. OCI_ATTR_SERVER Returns the pointer to the server context attribute when this attribute is read. Sets the server context attribute when this attribute is modified.
OCI_HTYPE_SVCCTX The context handle. OCI_ATTR_SESSION Returns the pointer to the authentication context attribute when this attribute is read. Sets the authentication context attribute when this attribute is modified.
OCI_HTYPE_SVCCTX The context handle. OCI_ATTR_TRANS Returns the pointer to the transaction context attribute when this attribute is read. Sets the transaction context attribute when this attribute is modified.
OCI_HTYPE_SESSION The session handle. OCI_ATTR_USERNAME The client certificate for proxy authentication.
OCI_HTYPE_SESSION The session handle. OCI_ATTR_PASSWORD The password for authentication.
OCI_HTYPE_STMT The statement handle. OCI_ATTR_PREFETCH_MEMORY The memory level for top-level rows to be prefetched.
OCI_HTYPE_STMT The statement handle. OCI_ATTR_PREFETCH_ROWS The number of top-level rows to be prefetched. Default value:1.
OCI_HTYPE_STMT The statement handle. OCI_ATTR_FETCH_ROWID The ROWID.
OCI_HTYPE_BIND The parameter-bound handle. OCI_ATTR_MAXDATA_SIZE The maximum number of bytes allowed in the server buffer to accommodate the client-bound data after character set conversion.
OCI_HTYPE_BIND The parameter-bound handle. OCI_ATTR_CHARSET_FORM The character set form of the define handle.
OCI_HTYPE_BIND The parameter-bound handle. OCI_ATTR_CHARSET_ID The character set ID of the define handle.
OCI_DTYPE_LOB The large object (LOB) handle. OCI_ATTR_LOBEMPTY Sets the internal LOB locator to empty. Then, the locator can be used as a bound variable of an INSERT or UPDATE statement to initialize LOB to empty.
OCI_HTYPE_TRANS The transaction handle. OCI_ATTR_XID Sets or reads the transaction ID (XID) that identifies a transaction.
OCI_HTYPE_SERVER The server handle. OCI_ATTR_EXTERNAL_NAME The external name of the database. The external name is a user-friendly global name stored in sys.props$.value$. The name may not be unique unless all databases register their names with the network directory service.
OCI_HTYPE_SERVER The server handle. OCI_ATTR_INTERNAL_NAME The name of the client database that is recorded when a global transaction is executed. Database administrators (DBAs) use the name to track transactions that may be suspended after failed executions.

OCIDescriptorAlloc

Description : You can call this function to allocate storage to hold LOB descriptor handles.

Function syntax :

sword OCIDescriptorAlloc ( CONST dvoid *parenth,
dvoid **descpp,
ub4 type,
size_t xtramem_sz,
dvoid **usrmempp);

Parameters :

Parameter
Description
parenth(IN) The environment handle.
descpp(OUT) The pointer that stores LOB descriptors.
type(IN) The type of the descriptor. For supported types, see the descriptor table in the Description section.
xtramem_sz(IN) The amount of extra memory to be allocated.
usrmempp(IN) Returns the address of the extra memory allocated.

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

Description : The following table describes the descriptors that the OCIDescriptorAlloc() function supports.

Descriptor
Description
OCI_DTYPE_LOB The LOB descriptor.
OCI_DTYPE_TIME The TIME descriptor.
OCI_DTYPE_TIMESTAMP The TIMESTAMP descriptor.
OCI_DTYPE_TIMESTAMP_LTZ The TIMESTAMP WITH LOCAL TIME ZONE descriptor.
OCI_DTYPE_TIMESTAMP_TZ The TIMESTAMP WITH TIME ZONE descriptor.
OCI_DTYPE_DATE The DATE descriptor.
OCI_DTYPE_ROWID The ROWID descriptor.

OCIDescriptorFree

Description : You can call this function to release a descriptor allocated by calling the OCIDescriptorAlloc() function.

Function syntax :

sword OCIArrayDescriptorFree ( void **descp,
const ub4 type );

Parameters :

Parameter
Description
descp(IN) The pointer to a descriptor.
type(IN) The type of the descriptor. For supported types, see the descriptor table in the Description section.

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

Description : The following table describes the descriptors that the OCIArrayDescriptorFree() function supports.

Descriptor
Description
OCI_DTYPE_LOB The LOB descriptor.
OCI_DTYPE_TIME The TIME descriptor.
OCI_DTYPE_TIMESTAMP The TIMESTAMP descriptor.
OCI_DTYPE_TIMESTAMP_LTZ The TIMESTAMP WITH LOCAL TIME ZONE descriptor.
OCI_DTYPE_TIMESTAMP_TZ The TIMESTAMP WITH TIME ZONE descriptor.
OCI_DTYPE_DATE The DATE descriptor.
OCI_DTYPE_ROWID The ROWID descriptor.
OCI_DTYPE_PARAM The parameter descriptor.

OCIHandleAlloc

Description : You can call this function to allocate and initialize handles.

Function syntax :

sword OCIHandleAlloc ( CONST dvoid *parenth,
dvoid **hndlpp,
ub4 type,
size_t xtramem_sz,
dvoid **usrmempp );

Parameters :

Parameter
Description
parentth(IN) The environment handle.
hndlpp(OUT) The pointer to a handle.
type(IN) The type of the handle. For supported handle types, see the handle table in the Description section.
xtramem_sz(IN) The amount of extra memory to be allocated.
usrmempp(IN) Returns the address of the extra memory allocated.

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

Description : The following table describes the handles that can be allocated by calling the OCIHandleAlloc() function.

Handle
Description
OCI_HTYPE_ERROR The error handle.
OCI_HTYPE_SVCCTX The context handle.
OCI_HTYPE_STMT The statement handle.
OCI_HTYPE_SERVER The server handle.
OCI_HTYPE_SESSION The session handle.
OCI_HTYPE_TRANS The transaction handle.
OCI_HTYPE_BIND The parameter-bound handle.
OCI_HTYPE_DEFINE The column-bound handle.

OCIHandleFree

Description : You can call this function to release handles allocated by calling the OCIHandleAlloc() function.

Function syntax :

sword OCIHandleFree ( dvoid *hndlp,
ub4 type );

Parameters :

Parameter
Description
hndlp(IN) The pointer to a handle.
type(IN) The type of the handle. For supported handle types, see the handle table in the Description section.

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

Description : The following table describes the handles that can be allocated by calling the OCIHandleFree() function.

Handle
Description
OCI_HTYPE_ERROR The error handle.
OCI_HTYPE_SVCCTX The context handle.
OCI_HTYPE_STMT The statement handle.
OCI_HTYPE_SERVER The server handle.
OCI_HTYPE_SESSION The session handle.
OCI_HTYPE_TRANS The transaction handle.
OCI_HTYPE_BIND The parameter-bound handle.
OCI_HTYPE_DEFINE The column-bound handle.
OCI_HTYPE_ENV The environment handle.

OCIParamGet

Description : You can call this function to obtain a descriptor handle at a specified position.

Function syntax :

sword OCIParamGet ( CONST dvoid *hndlp,
ub4 htype,
OCIError *errhp,
dvoid **parmdpp,
ub4 pos );

Parameters :

Parameter
Description
hndlp(IN) The handle that contains descriptive information.
htype(IN) The type of the handle specified by the hndlp parameter. For supported handle types, see the handle table in the Description section.
errhp(IN) The error handle.
parmdpp(OUT) The output descriptor handle.
pos(IN) The position in the descriptor from which the descriptive information is to be obtained.

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

Description : The following table describes the parameter handles that can be obtained by calling the OCIParamGet() function.

Handle
Description
OCI_HTYPE_STMT The statement handle.
OCI_DTYPE_PARAM The parameter handle.

Previous topic

Connect, authorize, and initialize functions
Last

Next topic

Bind, define, and describe functions
Next
What is on this page
OCIAttrGet
OCIAttrSet
OCIDescriptorAlloc
OCIDescriptorFree
OCIHandleAlloc
OCIHandleFree
OCIParamGet