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

Data types

Last Updated:2023-06-29 06:42:20  Updated
share
What is on this page
Internal data types
External data types
Data type conversion

folded

share

OceanBase Call Interface (OBCI) supports internal data types in Oracle mode of OceanBase Database and external data types of C language.

Internal data types

Internal data types can be used in Oracle mode of OceanBase Database. See the following table for common internal data types.

Data type Description Limit
CHAR A character string that has a fixed length. Maximum length: 2000
VARCHAR2 A character string that has a variable length. Maximum length: 32767
NUMBER A numeric value. Range of precision: 1 to 38 Range of scale: -84 to 127
INT An integer. Maximum number of digits: 38
BINARY_FLOAT A 32-bit floating-point number. Minimum value: 1.17549E-38F Maximum value: 3.40282E+38F
BINARY_DOUBLE A 64-bit floating-point number. Minimum value: 2.22507485850720E-308 Maximum value: 1.79769313486231E+308
DATE A date. Format: YYYY-MM-DD HH:MI:SS
TIMESTAMP A timestamp. Format: YYYY-MM-DD HH:MI:SS [.FFFFFFFFF]

External data types

External data types specify the types of data in host variables. When you import data to OceanBase Database, OBCI converts the external data types of the input host variables to the corresponding internal data types. When you export data to an external program, OBCI converts the internal data types of the database table to the corresponding external data types of the host variables.

The following table describes the common external data types.

External data type Code Data type of host variable OBCI type
VARCHAR2 1 char[n] SQLT_CHR
NUMBER 2 unsigned char[21] SQLT_NUM
8-bit signed INTEGER 3 signed char SQLT_INT
16-bit signed INTEGER 3 signed short, signed int SQLT_INT
32-bit signed INTEGER 3 signed int, signed long SQLT_INT
FLOAT 4 float, double SQLT_FLT
LONG 8 char[n] SQLT_LNG
NULL-terminated STRING 5 char[n+1] SQLT_STR
LONG 8 char[n] SQLT_LNG
VARCHAR 9 char[n+sizeof(short integer)] SQLT_VCS VARCHAR
DATE 12 unsigned char[n] SQLT_BIN
RAW 23 char[7] SQLT_DAT
CHAR 96 char[n] SQLT_AFC
REF 110 OCIRef SQLT_REF
Character LOB descriptor 112 OCILobLocator SQLT_CLOB
Binary LOB descriptor 113 OCILobLocator SQLT_BLOB
ANSI DATE descriptor 184 OCIDateTime * SQLT_DATE
TIMESTAMP descriptor 187 OCIDateTime * SQLT_TIMESTAMP
TIMESTAMP WITH TIME ZONEdescriptor 188 OCIDateTime * SQLT_TIMESTAMP_TZ
TIMESTAMP WITH LOCAL TIME ZONEdescriptor 232 OCIDateTime * SQLT_TIMESTAMP_LTZ

Data type conversion

In OBCI, host variables use external data types. When you read data from or write data to OceanBase Database, the data types are converted to and from C language variables.

The following lists the supported conversions.

  • IN indicates the conversion from a C language variable to an internal data type of OceanBase Database during data writes.

  • OUT indicates the conversion from an internal data type of OceanBase Database to a C language variable during data reads.

Note

The table does not include possible errors during the conversion. For example, errors such as overflow and invalid numbers may occur when OBCI converts a VARCHAR2 variable to CHAR in C.

VARCHAR2/CHAR INT NUMBER FLOAT BINARY_FLOAT BINARY_DOUBLE DATE TIMESTAMP
CHAR/UNSIGNED CHAR IN/OUT IN/OUT IN/OUT IN/OUT IN/OUT IN/OUT
INT/UNSIGNED INT IN/OUT IN/OUT IN/OUT IN/OUT IN/OUT IN/OUT
LONG/UNSIGNED LONG IN/OUT IN/OUT IN/OUT IN/OUT IN/OUT IN/OUT
LONG LONG/UNSIGNED LONG LONG IN/OUT IN/OUT IN/OUT IN/OUT IN/OUT IN/OUT
FLOAT IN/OUT IN/OUT IN/OUT IN/OUT IN/OUT IN/OUT
DOUBLE IN/OUT IN/OUT IN/OUT IN/OUT IN/OUT IN/OUT
CHAR[n]/VARCHAR[n]/CHAR* IN/OUT IN/OUT IN/OUT IN/OUT IN/OUT IN/OUT IN/OUT IN

Previous topic

Install OBCI
Last

Next topic

Basic development procedure
Next
What is on this page
Internal data types
External data types
Data type conversion