OceanBase
English日本語简体中文
Docs Home
Products
Integrations
Release Notes

Databases

OceanBase DatabaseOceanBase AI DatabaseOceanBase Cloud OceanSeekOceanBase Best Practices

Tools

OceanBase Cloud PlatformOceanBase Migration ServiceOceanBase Developer CenterOceanBase Migration AssessmentOceanBase Admin ToolOceanBase Loader and DumperOceanBase DeployerKubernetes operator for OceanBaseOceanBase Diagnostic Tool OceanBase Binlog ServiceOceanBase DataPilotOceanBase OAgent

Connectors and Middleware

OceanBase Database Proxy OceanBase Connector/C OceanBase Connector/J OceanBase Connector/ODBC OceanBase Connector/NETOceanBase Command-Line Client

Databases

OceanBase DatabaseOceanBase AI DatabaseOceanBase Cloud OceanSeekOceanBase Best Practices

Connectors and Middleware

OceanBase Database Proxy OceanBase Connector/C OceanBase Connector/J OceanBase Connector/ODBC OceanBase Connector/NETOceanBase Command-Line Client

Tools

OceanBase Cloud PlatformOceanBase Migration ServiceOceanBase Developer CenterOceanBase Migration AssessmentOceanBase Admin ToolOceanBase Loader and DumperOceanBase DeployerKubernetes operator for OceanBaseOceanBase Diagnostic Tool OceanBase Binlog ServiceOceanBase DataPilotOceanBase OAgent
OceanBase DatabaseOceanBase Cloud ToolsConnectors and MiddlewareLifecycle Support Policy

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

Document Feedback
  1. Documentation Center
  2. OceanBase Call Interface
  3. V2.1.0

String functions

Last Updated:2026-09-04 08:28:32

OCIStringAllocSize
OCIStringAssign
OCIStringAssignText
OCIStringPtr
OCIStringSize
OCIStringResize

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
on this page
OCIStringAllocSize
OCIStringAssign
OCIStringAssignText
OCIStringPtr
OCIStringSize
OCIStringResize