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

Locale functions

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

OCINlsEnvironmentVariableGet
OCINlsGetInfo
Parameter values

OCINlsEnvironmentVariableGet

Purpose : You can call this function to return the character set ID from NLS_LANG or the ID of the national character set from NLS_NCHAR.

Note

The OBServer supports only the following character sets: UTF-8, GBK, GB18030, and UTF-16.

Syntax :

sword OCINlsEnvironmentVariableGet ( void       *val,
size_t     size,
ub2        item,
ub2        charset, 
size_t     *rsize );

Parameters :

Parameter
Description
val (IN/OUT) Returns the value of a National Language Support (NLS) environment variable, such as the NLS_LANG character set ID or the NLS_NCHAR character set ID.
size (IN) The size of the given output value. The parameter is applicable only to string data. The maximum length of each piece of information is OCI_NLS_MAXBUFSZ bytes. For numeric data, this parameter is ignored.
item (IN) Obtains one of the following specified values from the NLS environment variable:
  • OCI_NLS_CHARSET_ID: the NLS_LANG character set ID in the ub2 data type.
  • OCI_NLS_NCHARSET_ID: the NLS_NCHAR character set ID in the ub2 data type.
charset (IN) The character set ID of the retrieved string data. If the value is 0, the NLS_LANG value is used. OCI_UTF16ID is a valid value for this parameter. For numeric data, this parameter is ignored.
rsize (OUT) The length of the return value (in bytes).

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

OCINlsGetInfo

Purpose : You can call this function to obtain the locale information specified in the Oracle Cloud Infrastructure (OCI) environment or in the handle, and to save the information, within the specified size, into your destination buffer.

Syntax :

sword OCINlsGetInfo ( void        *hndl, 
OCIError    *errhp, 
OraText     *buf, 
size_t      buflen, 
ub2         item );

Parameters :

Parameter
Description
hndl (IN/OUT) The OCI environment or user session handle initialized in object mode.
errhp (IN/OUT) The error handle. If any error occurs, the function records it in errhp and returns a NULL pointer. You can call the OCIErrorGet function to obtain the diagnostic information.
buf (OUT) The pointer to the destination buffer. The returned string ends with a NULL character.
buflen (IN) The size of the destination buffer. The maximum length of each piece of information is OCI_NLS_MAXBUFSZ bytes. OCI_NLS_MAXBUFSIZE: When you call the OCINlsGetInfo function, you must allocate a buffer to store the returned information. The buffer size depends on the item that you are querying and the encoding that you use to store the information. The OCI_NLS_MAXBUFSZ attribute ensures that the buffer is big enough to accommodate the largest item that the OCINlsGetInfo function returns.
item (IN) The item in the OCI environment handle to return. For information about the value, see the table in the Parameter values section.

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

Parameter values

Parameter value
Description
OCI_NLS_DAYNAME1 The native name of Monday.
OCI_NLS_DAYNAME2 The native name of Tuesday.
OCI_NLS_DAYNAME3 The native name of Wednesday.
OCI_NLS_DAYNAME4 The native name of Thursday.
OCI_NLS_DAYNAME5 The native name of Friday.
OCI_NLS_DAYNAME6 The native name of Saturday.
OCI_NLS_DAYNAME7 The native name of Sunday.
OCI_NLS_ABDAYNAME1 The abbreviated native name of Monday.
OCI_NLS_ABDAYNAME2 The abbreviated native name of Tuesday.
OCI_NLS_ABDAYNAME3 The abbreviated native name of Wednesday.
OCI_NLS_ABDAYNAME4 The abbreviated native name of Thursday.
OCI_NLS_ABDAYNAME5 The abbreviated native name of Friday.
OCI_NLS_ABDAYNAME6 The abbreviated native name of Saturday.
OCI_NLS_ABDAYNAME7 The abbreviated native name of Sunday.
OCI_NLS_MONTHNAME1 The native name of January.
OCI_NLS_MONTHNAME2 The native name of February.
OCI_NLS_MONTHNAME3 The native name of March.
OCI_NLS_MONTHNAME4 The native name of April.
OCI_NLS_MONTHNAME5 The native name of May.
OCI_NLS_MONTHNAME6 The native name of June.
OCI_NLS_MONTHNAME7 The native name of July.
OCI_NLS_MONTHNAME8 The native name of August.
OCI_NLS_MONTHNAME9 The native name of September.
OCI_NLS_MONTHNAME10 The native name of October.
OCI_NLS_MONTHNAME11 The native name of November.
OCI_NLS_MONTHNAME12 The native name of December.
OCI_NLS_ABMONTHNAME1 The abbreviated native name of January.
OCI_NLS_ABMONTHNAME2 The abbreviated native name of February.
OCI_NLS_ABMONTHNAME3 The abbreviated native name of March.
OCI_NLS_ABMONTHNAME4 The abbreviated native name of April.
OCI_NLS_ABMONTHNAME5 The abbreviated native name of May.
OCI_NLS_ABMONTHNAME6 The abbreviated native name of June.
OCI_NLS_ABMONTHNAME7 The abbreviated native name of July.
OCI_NLS_ABMONTHNAME8 The abbreviated native name of August.
OCI_NLS_ABMONTHNAME9 The abbreviated native name of September.
OCI_NLS_ABMONTHNAME10 The abbreviated native name of October.
OCI_NLS_ABMONTHNAME11 The abbreviated native name of November.
OCI_NLS_ABMONTHNAME12 The abbreviated native name of December.
OCI_NLS_YES The native string for an affirmative response.
OCI_NLS_NO The native negative response.
OCI_NLS_AM The native equivalent string of ante meridiem (AM).
OCI_NLS_PM The native equivalent string of post meridiem (PM).
OCI_NLS_AD The native equivalent string of anno Domini (AD).
OCI_NLS_BC The native equivalent string of before Christ (BC).
OCI_NLS_DECIMAL A decimal character.
OCI_NLS_GROUP A group separator.
OCI_NLS_DEBIT The native symbol of debit.
OCI_NLS_CREDIT The native symbol of credit.
OCI_NLS_DATEFORMAT The date format in Oracle Database.
OCI_NLS_INT_CURRENCY The international currency symbol.
OCI_NLS_DUAL_CURRENCY The dual currency symbol.
OCI_NLS_LOC_CURRENCY The locale currency symbol.
OCI_NLS_LANGUAGE The name of the language.
OCI_NLS_ABLANGUAGE The abbreviated name of the language.
OCI_NLS_TERRITORY The name of the territory.
OCI_NLS_CHARACTER_SET The character set name.
OCI_NLS_LINGUISTIC_NAME The linguistic sort name.
OCI_NLS_CALENDAR The calendar name.
OCI_NLS_WRITING_DIR The writing direction of the language.
OCI_NLS_ABTERRITORY The abbreviated name of the territory.
OCI_NLS_DDATEFORMAT The default date format in Oracle Database.
OCI_NLS_DTIMEFORMAT The default time format in Oracle Database.
OCI_NLS_SFDATEFORMAT The format of local date.
OCI_NLS_SFTIMEFORMAT The format of local time.
OCI_NLS_NUMGROUPING The number grouping field.
OCI_NLS_LISTSEP The list separator.
OCI_NLS_MONDECIMAL The monetary decimal character.
OCI_NLS_MONGROUP The monetary group separator.
OCI_NLS_MONGROUPING The monetary grouping field.
OCI_NLS_INT_CURRENCYSEP The international currency separator.

Previous topic

Describe functions
Last

Next topic

Define functions
Next
on this page
OCINlsEnvironmentVariableGet
OCINlsGetInfo
Parameter values