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 |
| 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.
|
| 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.