Oracle Call Interface Programmer's Guide Release 9.0.1 Part Number A89857-01 |
|
OCI Relational Functions, 26 of 39
This call is used to register user callbacks for dynamic data allocation.
sword OCIBindDynamic ( OCIBind *bindp, OCIError *errhp, dvoid *ictxp, OCICallbackInBind (icbfp)(/*_ dvoid *ictxp, OCIBind *bindp, ub4 iter, ub4 index, dvoid **bufpp, ub4 *alenp, ub1 *piecep, dvoid **indpp */), dvoid *octxp, OCICallbackOutBind (ocbfp)(/*_ dvoid *octxp, OCIBind *bindp, ub4 iter, ub4 index, dvoid **bufpp, ub4 **alenpp, ub1 *piecep, dvoid **indpp, ub2 **rcodepp _*/) );
A bind handle returned by a call to OCIBindByName()
or OCIBindByPos()
.
An error handle you can pass to OCIErrorGet()
for diagnostic information in the event of an error.
The context pointer required by the call back function icbfp
.
The callback function which returns a pointer to the IN bind value or piece at run time. The callback takes in the following parameters:
The context pointer for this callback function.
The bind handle passed in to uniquely identify this bind variable.
0-based execute iteration value.
Index of the current array, for an array bind in PL/SQL. For SQL it is the row index. The value is 0-based and not greater than curelep
parameter of the bind call.
The pointer to the buffer or storage. For descriptors, *bufpp
contains a pointer to the descriptor. For example if you define
OCILOBLocator *lobp;
then you would set *bufpp
to lobp
not *lobp
.
For REF
s, pass the address of the ref; i.e., pass &my_ref
for *bufpp
.
If the OCI_ATTR_CHARSET_ID attribute is set to OCI_UTF16ID (replaces the deprecated OCI_UCS2ID, which is retained for backward compatibility), all data passed to and received with the corresponding bind call is assumed to be in UTF-16 encoding.
A pointer to a storage for OCI to fill in the size of the bind value/piece after it has been read. For descriptors, pass the size of the pointer to the descriptor; e.g., sizeof(OCILobLocator *)
.
Which piece of the bind value. This can be one of the following values OCI_ONE_PIECE, OCI_FIRST_PIECE, OCI_NEXT_PIECE and OCI_LAST_PIECE. For datatypes that do not support piecewise operations, you must pass OCI_ONE_PIECE or an error will be generated.
Contains the indicator value. This is a pointer to either an sb2 value or a pointer to an indicator structure for binding named data types.
The context pointer required by the callback function ocbfp
.
The callback function which returns a pointer to the OUT bind value or piece at run time. The callback takes in the following parameters:
The context pointer for this call back function.
The bind handle passed in to uniquely identify this bind variable.
0-based execute iteration value.
For PL/SQL index of the current array, for an array bind. For SQL, the index is the row number in the current iteration. It is 0-based, and must not be greater than curelep
parameter of the bind call.
A pointer to a buffer to write the bind value/piece.
If the OCI_ATTR_CHARSET_ID attribute is set to OCI_UTF16ID (replaces the deprecated OCI_UCS2ID, which is retained for backward compatibility), all data passed to and received with the corresponding bind call is assumed to be in UTF-16 encoding. For more information, refer to OCI_ATTR_CHARSET_ID.
A pointer to a storage for OCI to fill in the size of the bind value/piece after it has been read. It is in bytes except for Unicode encoding (if the OCI_ATTR_CHARSET_ID attribute is set to OCI_UTF16ID), when it is in codepoints.
Returns a piece value from the callback (application) to Oracle, as follows:
Returns a pointer to contain the indicator value which either an sb2 value or a pointer to an indicator structure for named data types.
Returns a pointer to contains the return code.
This call is used to register user-defined callback functions for providing or receiving data if OCI_DATA_AT_EXEC mode was specified in a previous call to OCIBindByName()
or OCIBindByPos()
.
The callback function pointers must return OCI_CONTINUE if it the call is successful. Any return code other than OCI_CONTINUE signals that the client wishes to abort processing immediately.
See Also:
For more information about the OCI_DATA_AT_EXEC mode, see the section "Runtime Data Allocation and Piecewise Operations". |
When passing the address of a storage area, make sure that the storage area will exist even after the application returns from the callback. This means that you should not allocate such storage on the stack.
|
Copyright © 1996-2001, Oracle Corporation. All Rights Reserved. |
|