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

LoB functions

Last Updated:2023-06-29 06:42:04  Updated
Share
What is on this page
OCILobGetLength
OCILobRead
OCILobWrite
OCILobLocatorIsInit
OCILobOpen
OCILobClose
OCILobIsOpen
OCILobTrim
OCILobTrim2

folded

Share

#docslug#/obci/obci/V2.0.1/wbz81w

OCILobGetLength

Description : You can call this function to return the length of a large object (LOB) in bytes.

Function prototype :

sword OCILobGetLength ( 
OCISvcCtx *svchp,
OCIError *errhp,
OCILobLocator *locp,
ub4 *lenp );

Parameters :

Parameter
Description
svchp(IN) A pointer to a service context handle.
errhp(IN/OUT) An error handle.
locp(IN) A pointer to an LOB locator.
lenp(OUT) Returns the length of an LOB, in bytes.

Return value : OCI_SUCCESS if succeeded, or OCI_ERROR if failed.

OCILobRead

Description : You can call this function to read the content of a specified length from an LOB.

Function prototype :

sword OCILobRead ( 
    OCISvcCtx *svchp,
    OCIError *errhp,
    OCILobLocator *locp,
    ub4 *amtp,
    ub4 offset,
    dvoid *bufp,
    ub4 bufl,
    dvoid *ctxp,
    OCICallbackLobRead (cbfp)
                        ( dvoid *ctxp,
                        CONST dvoid *bufp,
                        ub4 len,
                        ub1 piece
                        )
    ub2 csid,
    ub1 csfrm );

Parameters :

Parameter
Description
svchp(IN) A pointer to a service context handle.
errhp(IN/OUT) An error handle.
locp(IN) A pointer to an LOB locator.
Amtp(IN/OUT) This parameter indicates the amount of input or output bytes. When the function is called, this parameter indicates the number of bytes to be read. Upon the end of function execution, OBCI backfills the number of bytes that was actually read.
offset A reserved parameter.
bufp(IN) The pointer to the buffer that stores the data read.
bufl(IN) The length of the buffer that stores the data read.
ctxp A reserved parameter.
cbfp A reserved parameter.
csid A reserved parameter.
csfrm A reserved parameter.

Return value : OCI_NEED_DATA if the execution was successful, but not all data was read. OCI_SUCCESS if succeeded. OCI_ERROR if failed.

OCILobWrite

Description : You can call this function to continuously write content into an LOB.

Function prototype :

sword OCILobWrite ( 
    OCISvcCtx *svchp,
    OCIError *errhp,
    OCILobLocator *locp,
    ub4 *amtp,
    ub4 offset,
    void *bufp,
    ub4 buflen,
    ub1 piece,
    void *ctxp,
    OCICallbackLobWrite (cbfp) 
                   (
                    void *ctxp,
                    void *bufp,
                    ub4 *lenp,
                    ub1 *piecep
                    )
    ub2 csid,
    ub1 csfrm );

Parameters :

Parameter
Description
svchp(IN) A pointer to a service context handle.
errhp(IN/OUT) An error handle.
locp(IN) A pointer to an LOB locator.
amtp(IN/OUT) This parameter indicates the amount of input or output bytes. When the function is called, this parameter indicates the number of bytes to be read. Upon the end of function execution, OBCI backfills the number of bytes that was actually read.
offset A reserved parameter.
bufp(IN) The pointer to the buffer that stores the data read.
buflen(IN) The length of the buffer that stores the data read.
piece A reserved parameter.
ctxp A reserved parameter.
cbfp A reserved parameter.
csid A reserved parameter.
csfrm A reserved parameter.

Return value : OCI_SUCCESS if succeeded, or OCI_ERROR if failed.

OCILobLocatorIsInit

Description : You can call this function to verify whether the given LOB or BFILE locator is initialized.

Function prototype :

sword OCILobLocatorIsInit (
OCIEnv *envhp,
OCIError *errhp,
const OCILobLocator *locp,
boolean *is_initialized );

Parameters :

Parameter
Description
svchp(IN/OUT) A pointer to a service context handle.
errhp(IN/OUT) An error handle.
locp(IN) An LOB or BFILE locator.
is_initialized (OUT) Returns TRUE if the given LOB or BFILE locator is initialized, and FALSE if it is not.

Return value : OCI_SUCCESS if succeeded, or OCI_ERROR if failed.

OCILobOpen

Description : You can call this function to open an LOB or BFILE object.

Function prototype :

sword OCILobOpen ( 
OCISvcCtx *svchp,
OCIError *errhp,
OCILobLocator *locp,
ub1 mode );

Parameters :

Parameter
Description
svchp(IN) A pointer to a service context handle.
errhp(IN/OUT) An error handle.
locp(IN/OUT) An LOB or BFILE locator.
mode (IN) The mode of the operation.

Return value : OCI_SUCCESS if succeeded, or OCI_ERROR if failed.

OCILobClose

Description : You can call this function to close an LOB or BFILE object.

Function prototype :

sword OCILobClose ( OCISvcCtx *svchp,
OCIError *errhp,
OCILobLocator *locp );

Parameters :

Parameter
Description
svchp(IN) A pointer to a service context handle.
errhp(IN/OUT) An error handle.
locp(IN/OUT) An LOB or BFILE locator.

Return value : OCI_SUCCESS if succeeded, or OCI_ERROR if failed.

OCILobIsOpen

Description : You can call this function to test whether an LOB or FILE object is open.

Function prototype :

sword OCILobIsOpen ( 
OCISvcCtx        *svchp,
OCIError         *errhp,
OCILobLocator    *locp,
boolean          *flag );

Parameters :

Parameter
Description
svchp(IN) A pointer to a service context handle.
errhp(IN/OUT) An error handle.
locp(IN) An LOB or FILE handle.
flag(OUT) Returns TRUE if the LOB or FILE is open, or FALSE if otherwise.

Return value : OCI_SUCCESS if succeeded, or OCI_ERROR if failed.

OCILobTrim

Description : You can call this function to trim the LOB value to a shorter length.

Function prototype :

sword OCILobTrim ( 
OCISvcCtx       *svchp,
OCIError        *errhp,
OCILobLocator   *locp,
ub4             newlen );

Parameters :

Parameter
Description
svchp(IN) A pointer to a service context handle.
errhp(IN/OUT) An error handle.
locp(IN) An LOB or FILE handle.
newlen(IN) The new length of the LOB value, which must be shorter than or equal to the current length. For character LOBs, it indicates the number of characters, and for binary LOBs and BFILEs, it indicates the number of bytes in an LOB.

Return value : OCI_SUCCESS if succeeded, or OCI_ERROR if failed.

OCILobTrim2

Description : You can call this function to trim the LOB value to a shorter length. This function must be used for LOBs that are greater than 4 GB. You can also use this function for LOBs that are smaller than 4 GB.

Function prototype :

sword OCILobTrim2 ( 
OCISvcCtx       *svchp,
OCIError        *errhp,
OCILobLocator   *locp,
ub4             newlen );

Parameters :

Parameter
Description
svchp(IN) A pointer to a service context handle.
errhp(IN/OUT) An error handle.
locp(IN) An LOB or FILE handle.
newlen(IN) The new length of the LOB value, which must be shorter than or equal to the current length. For character LOBs, it indicates the number of characters, and for binary LOBs and BFILEs, it indicates the number of bytes in an LOB.

Return value : OCI_SUCCESS if succeeded, or OCI_ERROR if failed.

Previous topic

Statement functions
Last

Next topic

Transaction functions
Next
What is on this page
OCILobGetLength
OCILobRead
OCILobWrite
OCILobLocatorIsInit
OCILobOpen
OCILobClose
OCILobIsOpen
OCILobTrim
OCILobTrim2