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

String functions

Last Updated:2023-06-29 06:42:20  Updated
share
What is on this page
OCIStringAllocSize
OCIStringAssign
OCIStringAssignText
OCIStringPtr
OCIStringSize
OCIStringResize

folded

share

OCIStringAllocSize

Description : You can call this function to get the allocated size of string memory in bytes or code points (Unicode).

Function prototype :

sword OCIStringAllocSize ( 
OCIEnv              *env,
OCIError            *err,
const OCIString     *vs,
ub4                 *allocsize );

Parameters :

Parameter Description
env (IN/OUT) A pointer to a service context handle.
err(IN/OUT) An error handle.
vs(IN) Returns a string whose allocated size is measured in bytes. vs must be a non-NULL pointer.
allocsize(OUT) Returns the allocated size of string memory in bytes.

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

OCIStringAssign

Description : You can call this function to assign the source text string to the target string.

Function prototype :

sword OCIStringAssign ( 
OCIEnv               *env,
OCIError             *err,
const OCIString      *rhs,
OCIString            **lhs );

Parameters :

Parameter Description
env (IN/OUT) A pointer to a service context handle.
err(IN/OUT) An error handle.
rhs(IN) The right-hand side (source string) of the assignment.
lhs(IN/OUT) The left-hand side (target string) of the assignment.

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

OCIStringAssignText

Description : You can call this function to assign the source text string to the target string.

Function prototype :

sword OCIStringAssignText ( 
OCIEnv           *env,
OCIError         *err,
const OraText    *rhs,
ub4              rhs_len,
OCIString        **lhs );

Parameters :

Parameter Description
env (IN/OUT) A pointer to a service context handle.
err(IN/OUT) An error handle.
rhs(IN) The right-hand side (source string) of the assignment.
rhs_len(IN) The length of the string.
lhs(IN/OUT) The left-hand side (target string) of the assignment.

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

OCIStringPtr

Description : You can call this function to get the pointer to the text of a given string.

Function prototype :

text *OCIStringPtr ( 
OCIEnv               *env,
const OCIString      *vs );

Parameters :

Parameter Description
env (IN/OUT) A pointer to a service context handle.
vs(IN) The pointer to the OCIString object whose character string is to be returned. If the encoding of vs is UTF-16, that of the returned buffer is also UTF-16. To know the encoding of the returned buffer, check UTF-16 information in OCIString vs. This is because a particular OCIString may not have the same settings as the env does. The check function should be an object OCI function that is designed to check member fields in objects.

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

OCIStringSize

Description : You can call this function to get the size of the pointer text of a given string.

Function prototype :

ub4 OCIStringSize ( 
OCIEnv              *env,
const OCIString     *vs );

Parameters :

Parameter Description
env (IN/OUT) A pointer to a service context handle.
vs(IN) Returns the size of the string in bytes.

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

OCIStringResize

Description : You can call this function to resize the memory of a given string.

Function prototype :

sword OCIStringResize ( 
OCIEnv          *env,
OCIError        *err,
ub4             new_size,
OCIString       **str );

Parameters :

Parameter Description
env (IN/OUT) A pointer to a service context handle.
err(IN/OUT) An error handle.
new_size(IN) The new memory size of the string, in bytes. new_size must include space for the NULL character as the string terminator.
str(IN/OUT) The memory that is allocated for the string and freed from the OCI object cache.

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

Previous topic

Miscellaneous functions
Last

Next topic

Date and Datetime functions
Next
What is on this page
OCIStringAllocSize
OCIStringAssign
OCIStringAssignText
OCIStringPtr
OCIStringSize
OCIStringResize