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

Define functions

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

OCIDefineDynamic

OCIDefineDynamic

Purpose : You can call this function to set the additional attributes required when the OCI_DYNAMIC_FETCH mode is selected in the OCIDefineByPos() or OCIDefineByPos2() function.

Syntax :

sword OCIDefineDynamic ( OCIDefine   *defnp,
                         OCIError    *errhp,
                         void        *octxp, 
                         OCICallbackDefine      (ocbfp)(
                                  void          *octxp,
                                  OCIDefine     *defnp,
                                  ub4            iter, 
                                  void         **bufpp,
                                  ub4          **alenpp,
                                  ub1           *piecep,
                                  void         **indpp,
                                  ub2          **rcodep );

Parameters :

Parameter
Description
defnp (IN/OUT) The handle to a define structure that is returned when the OCIDefineByPos() function is called.
errhp (IN/OUT) An error handle. When an error occurs, you can pass it to the OCIErrorGet() function to obtain the diagnostic information.
octxp (IN) Points to a context for the callback function.
ocbfp (IN) Points to the callback function. This parameter is called at runtime to obtain a pointer to a buffer. The buffer is used to retrieve the obtained data or a piece of it. The callback also specifies the indicator, return code, and lengths of the data piece and indicator.
Note
Generally, in an Oracle Cloud Infrastructure (OCI) function, an IN parameter refers to the data passed to OCI and an OUT parameter refers to the data returned from OCI. It is the opposite for a callback function, where IN indicates that data is passed from OCI to the callback function, while OUT indicates that data is passed from the callback function to OCI.
octxp (IN/OUT) A parameter of the callback function. It is a context pointer to all the callback functions. When the client library needs a buffer to return the obtained data, the callback function will be used to provide a runtime buffer into which a piece or the whole data will be returned.
defnp (IN) A parameter of the callback function. It specifies the define handle.
iter (IN) A parameter of the callback function. It specifies which row is currently fetched. The parameter is 0-based.
bufpp (OUT) A parameter of the callback function. It returns a pointer to a buffer to store the column values, which means that *bufpp points to some proper storage for the column values.
alenpp (IN/OUT) A parameter of the callback function. The parameter is used by applications to set the size of the storage provided in *bufpp. After the data is fetched to the buffer, alenpp indicates the actual data size in bytes. If the length of the buffer provided in the first call is insufficient to store all the data returned from the server, the callback function is used again, and so forth.
piecep (IN/OUT) A parameter of the callback function. It returns a piece value from a callback (application) to OCI. The piecep parameter indicates whether the piece to be obtained is the first piece (OCI_FIRST_PIECE), a subsequent piece (OCI_NEXT_PIECE), or the last piece (OCI_LAST_PIECE). The application can process the piece in the next callback, or at the end of a series of callbacks.
  • IN: The value can be OCI_ONE_PIECE, OCI_FIRST_PIECE, or OCI_NEXT_PIECE.
  • OUT: The value depends on the value of IN.
    • If the value of IN is OCI_ONE_PIECE, the value of OUT is OCI_ONE_PIECE.
    • If the value of IN is OCI_FIRST_PIECE, the value of OUT is OCI_ONE_PIECE or OCI_FIRST_PIECE.
    • If the value of IN is OCI_NEXT_PIECE, the value of OUT is OCI_NEXT_PIECE or OCI_LAST_PIECE.
indpp (IN) A parameter of the callback function. It is an indicator variable pointer.
rcodep (IN) A parameter of the callback function. It returns a code variable pointer.

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

Previous topic

Locale functions
Last

Next topic

Full-link Diagnostic Trace
Next
on this page
OCIDefineDynamic