#docslug#/obci/obci/V2.0.1/vryn9e
OCIAttrGet
Description : You can call this function to obtain an attribute value of a handle.
Function syntax :
sword OCIAttrGet ( CONST dvoid *trgthndlp,
ub4 trghndltyp,
dvoid *attributep,
ub4 *sizep,
ub4 attrtype,
OCIError *errhp );
Parameters :
Parameter |
Description |
|---|---|
| trgthndlp(IN) | The pointer to the handle whose attribute value is to be obtained. |
| trghndltyp(IN) | The handle type. For supported handle types, see the handle attribute table in the Description section. |
| attributep(OUT) | The buffer that stores output attributes. |
| size(OUT) | The buffer that stores the size of output attributes. |
| attrtype(IN) | The type of the attribute to be obtained. |
| errhp(IN) | The error handle. |
Return value : OCI_SUCCESS is returned if the function call succeeded, or OCI_ERROR is returned if the function call failed.
Description : The following table describes the handles and their attributes that can be obtained by calling the OCIAttrGet() function.
Handle |
Handle description |
Attribute |
Attribute description |
|---|---|---|---|
| OCI_HTYPE_SVCCTX | The context handle. | OCI_ATTR_SERVER | Returns the pointer to the server context attribute when this attribute is read. Sets the server context attribute when this attribute is modified. |
| OCI_HTYPE_SVCCTX | The context handle. | OCI_ATTR_SESSION | Returns the pointer to the authentication context attribute when this attribute is read. Sets the authentication context attribute when this attribute is modified. |
| OCI_HTYPE_SVCCTX | The context handle. | OCI_ATTR_TRANS | Returns the pointer to the transaction context attribute when this attribute is read. Sets the transaction context attribute when this attribute is modified. |
| OCI_HTYPE_SESSION | The session handle. | OCI_ATTR_USERNAME | The client certificate for proxy authentication. |
| OCI_HTYPE_STMT | The statement handle. | OCI_ATTR_ROW_COUNT | Returns the number of rows converted after the OCIDirPathColArrayToStream() function is called. |
| OCI_HTYPE_STMT | The statement handle. | OCI_ATTR_CURRENT_POSITION | The current position in the result set. This attribute can only be retrieved and cannot be configured. |
| OCI_HTYPE_STMT | The statement handle. | OCI_ATTR_ROWS_FETCHED | The number of rows that were fetched into the user buffers in the last fetch or the number of rows executed in non-zero iterations. This attribute can be used for both scrollable and nonscrollable statement handles. |
| OCI_HTYPE_STMT | The statement handle. | OCI_ATTR_PARAM_COUNT | Returns the number of parameters in the describe handle. |
| OCI_HTYPE_STMT | The statement handle. | OCI_ATTR_NUM_DML_ERRORS | Returns the number of errors occurred in the DML operation. |
| OCI_HTYPE_STMT | The statement handle. | OCI_ATTR_ROWID | Returns the ROWID descriptor allocated to the OCIDescriptorAlloc() function. |
| OCI_DTYPE_PARAM | The parameter descriptor handle. | OCI_ATTR_DATA_TYPE | Returns or sets the external data type of the column. |
| OCI_DTYPE_PARAM | The parameter descriptor handle. | OCI_ATTR_CHAR_SIZE | Returns the length of the column, which is the number of characters allowed in the column. |
| OCI_DTYPE_PARAM | The parameter descriptor handle. | OCI_ATTR_CHARSET_ID | The ID of the character set. |
| OCI_DTYPE_PARAM | The parameter descriptor handle. | OCI_ATTR_DATA_SIZE | The maximum length of the column. The length is calculated in bytes instead of strings or original characters. |
| OCI_DTYPE_PARAM | The parameter descriptor handle. | OCI_ATTR_PRECISION | Returns or sets the precision. |
| OCI_DTYPE_PARAM | The parameter descriptor handle. | OCI_ATTR_SCALE | Returns or sets the number of digits to the right of the decimal point. |
| OCI_DTYPE_PARAM | The parameter descriptor handle. | OCI_ATTR_NAME | The name of the table to be loaded. |
| OCI_DTYPE_PARAM | The parameter descriptor handle. | OCI_ATTR_IS_NULL | Returns 0 if the column value cannot be NULL. |
| OCI_HTYPE_ERROR | The error handle. | OCI_ATTR_DML_ROW_OFFSET | Returns the offset at which the error occurred. |
| OCI_HTYPE_SERVER | The server handle. | OCI_ATTR_EXTERNAL_NAME | The external name of the database. The external name is a user-friendly global name stored in sys.props$.value$. The name may not be unique unless all databases register their names with the network directory service. |
| OCI_HTYPE_SERVER | The server handle. | OCI_ATTR_INTERNAL_NAME | The name of the client database that is recorded when a global transaction is executed. Database administrators (DBAs) use the name to track transactions that may be suspended after failed executions. |
OCIAttrSet
Description : You can call this function to set an attribute for a handle.
Function syntax :
sword OCIAttrSet ( dvoid *trgthndlp,
ub4 trghndltyp,
dvoid *attributep,
ub4 size,
ub4 attrtype,
OCIError *errhp );
Parameters :
Parameter |
Description |
|---|---|
| trgthndlp(IN) | The pointer to the handle whose attribute needs to be set. |
| trghndltyp(IN) | The type of the handle that needs to obtain an attribute. For supported handle types, see the handle attribute table in the Description section. |
| attributep(IN) | The pointer whose attribute needs to be set. |
| size(IN) | The size of the attributep parameter. |
| attrtype(IN) | The type of the attribute that needs to be set. |
| errhp(IN) | The error handle. |
Return value : OCI_SUCCESS is returned if the function call succeeded, or OCI_ERROR is returned if the function call failed.
Description : The following table describes the handles and their attributes that can be set by calling the OCIAttrSet() function.
Handle |
Handle description |
Attribute |
Attribute description |
|---|---|---|---|
| OCI_HTYPE_SVCCTX | The context handle. | OCI_ATTR_SERVER | Returns the pointer to the server context attribute when this attribute is read. Sets the server context attribute when this attribute is modified. |
| OCI_HTYPE_SVCCTX | The context handle. | OCI_ATTR_SESSION | Returns the pointer to the authentication context attribute when this attribute is read. Sets the authentication context attribute when this attribute is modified. |
| OCI_HTYPE_SVCCTX | The context handle. | OCI_ATTR_TRANS | Returns the pointer to the transaction context attribute when this attribute is read. Sets the transaction context attribute when this attribute is modified. |
| OCI_HTYPE_SESSION | The session handle. | OCI_ATTR_USERNAME | The client certificate for proxy authentication. |
| OCI_HTYPE_SESSION | The session handle. | OCI_ATTR_PASSWORD | The password for authentication. |
| OCI_HTYPE_STMT | The statement handle. | OCI_ATTR_PREFETCH_MEMORY | The memory level for top-level rows to be prefetched. |
| OCI_HTYPE_STMT | The statement handle. | OCI_ATTR_PREFETCH_ROWS | The number of top-level rows to be prefetched. Default value:1. |
| OCI_HTYPE_STMT | The statement handle. | OCI_ATTR_FETCH_ROWID | The ROWID. |
| OCI_HTYPE_BIND | The parameter-bound handle. | OCI_ATTR_MAXDATA_SIZE | The maximum number of bytes allowed in the server buffer to accommodate the client-bound data after character set conversion. |
| OCI_HTYPE_BIND | The parameter-bound handle. | OCI_ATTR_CHARSET_FORM | The character set form of the define handle. |
| OCI_HTYPE_BIND | The parameter-bound handle. | OCI_ATTR_CHARSET_ID | The character set ID of the define handle. |
| OCI_DTYPE_LOB | The large object (LOB) handle. | OCI_ATTR_LOBEMPTY | Sets the internal LOB locator to empty. Then, the locator can be used as a bound variable of an INSERT or UPDATE statement to initialize LOB to empty. |
| OCI_HTYPE_TRANS | The transaction handle. | OCI_ATTR_XID | Sets or reads the transaction ID (XID) that identifies a transaction. |
| OCI_HTYPE_SERVER | The server handle. | OCI_ATTR_EXTERNAL_NAME | The external name of the database. The external name is a user-friendly global name stored in sys.props$.value$. The name may not be unique unless all databases register their names with the network directory service. |
| OCI_HTYPE_SERVER | The server handle. | OCI_ATTR_INTERNAL_NAME | The name of the client database that is recorded when a global transaction is executed. Database administrators (DBAs) use the name to track transactions that may be suspended after failed executions. |
OCIDescriptorAlloc
Description : You can call this function to allocate storage to hold LOB descriptor handles.
Function syntax :
sword OCIDescriptorAlloc ( CONST dvoid *parenth,
dvoid **descpp,
ub4 type,
size_t xtramem_sz,
dvoid **usrmempp);
Parameters :
Parameter |
Description |
|---|---|
| parenth(IN) | The environment handle. |
| descpp(OUT) | The pointer that stores LOB descriptors. |
| type(IN) | The type of the descriptor. For supported types, see the descriptor table in the Description section. |
| xtramem_sz(IN) | The amount of extra memory to be allocated. |
| usrmempp(IN) | Returns the address of the extra memory allocated. |
Return value : OCI_SUCCESS is returned if the function call succeeded, or OCI_ERROR is returned if the function call failed.
Description : The following table describes the descriptors that the OCIDescriptorAlloc() function supports.
Descriptor |
Description |
|---|---|
| OCI_DTYPE_LOB | The LOB descriptor. |
| OCI_DTYPE_TIME | The TIME descriptor. |
| OCI_DTYPE_TIMESTAMP | The TIMESTAMP descriptor. |
| OCI_DTYPE_TIMESTAMP_LTZ | The TIMESTAMP WITH LOCAL TIME ZONE descriptor. |
| OCI_DTYPE_TIMESTAMP_TZ | The TIMESTAMP WITH TIME ZONE descriptor. |
| OCI_DTYPE_DATE | The DATE descriptor. |
| OCI_DTYPE_ROWID | The ROWID descriptor. |
OCIDescriptorFree
Description : You can call this function to release a descriptor allocated by calling the OCIDescriptorAlloc() function.
Function syntax :
sword OCIArrayDescriptorFree ( void **descp,
const ub4 type );
Parameters :
Parameter |
Description |
|---|---|
| descp(IN) | The pointer to a descriptor. |
| type(IN) | The type of the descriptor. For supported types, see the descriptor table in the Description section. |
Return value : OCI_SUCCESS is returned if the function call succeeded, or OCI_ERROR is returned if the function call failed.
Description : The following table describes the descriptors that the OCIArrayDescriptorFree() function supports.
Descriptor |
Description |
|---|---|
| OCI_DTYPE_LOB | The LOB descriptor. |
| OCI_DTYPE_TIME | The TIME descriptor. |
| OCI_DTYPE_TIMESTAMP | The TIMESTAMP descriptor. |
| OCI_DTYPE_TIMESTAMP_LTZ | The TIMESTAMP WITH LOCAL TIME ZONE descriptor. |
| OCI_DTYPE_TIMESTAMP_TZ | The TIMESTAMP WITH TIME ZONE descriptor. |
| OCI_DTYPE_DATE | The DATE descriptor. |
| OCI_DTYPE_ROWID | The ROWID descriptor. |
| OCI_DTYPE_PARAM | The parameter descriptor. |
OCIHandleAlloc
Description : You can call this function to allocate and initialize handles.
Function syntax :
sword OCIHandleAlloc ( CONST dvoid *parenth,
dvoid **hndlpp,
ub4 type,
size_t xtramem_sz,
dvoid **usrmempp );
Parameters :
Parameter |
Description |
|---|---|
| parentth(IN) | The environment handle. |
| hndlpp(OUT) | The pointer to a handle. |
| type(IN) | The type of the handle. For supported handle types, see the handle table in the Description section. |
| xtramem_sz(IN) | The amount of extra memory to be allocated. |
| usrmempp(IN) | Returns the address of the extra memory allocated. |
Return value : OCI_SUCCESS is returned if the function call succeeded, or OCI_ERROR is returned if the function call failed.
Description : The following table describes the handles that can be allocated by calling the OCIHandleAlloc() function.
Handle |
Description |
|---|---|
| OCI_HTYPE_ERROR | The error handle. |
| OCI_HTYPE_SVCCTX | The context handle. |
| OCI_HTYPE_STMT | The statement handle. |
| OCI_HTYPE_SERVER | The server handle. |
| OCI_HTYPE_SESSION | The session handle. |
| OCI_HTYPE_TRANS | The transaction handle. |
| OCI_HTYPE_BIND | The parameter-bound handle. |
| OCI_HTYPE_DEFINE | The column-bound handle. |
OCIHandleFree
Description : You can call this function to release handles allocated by calling the OCIHandleAlloc() function.
Function syntax :
sword OCIHandleFree ( dvoid *hndlp,
ub4 type );
Parameters :
Parameter |
Description |
|---|---|
| hndlp(IN) | The pointer to a handle. |
| type(IN) | The type of the handle. For supported handle types, see the handle table in the Description section. |
Return value : OCI_SUCCESS is returned if the function call succeeded, or OCI_ERROR is returned if the function call failed.
Description : The following table describes the handles that can be allocated by calling the OCIHandleFree() function.
Handle |
Description |
|---|---|
| OCI_HTYPE_ERROR | The error handle. |
| OCI_HTYPE_SVCCTX | The context handle. |
| OCI_HTYPE_STMT | The statement handle. |
| OCI_HTYPE_SERVER | The server handle. |
| OCI_HTYPE_SESSION | The session handle. |
| OCI_HTYPE_TRANS | The transaction handle. |
| OCI_HTYPE_BIND | The parameter-bound handle. |
| OCI_HTYPE_DEFINE | The column-bound handle. |
| OCI_HTYPE_ENV | The environment handle. |
OCIParamGet
Description : You can call this function to obtain a descriptor handle at a specified position.
Function syntax :
sword OCIParamGet ( CONST dvoid *hndlp,
ub4 htype,
OCIError *errhp,
dvoid **parmdpp,
ub4 pos );
Parameters :
Parameter |
Description |
|---|---|
| hndlp(IN) | The handle that contains descriptive information. |
| htype(IN) | The type of the handle specified by the hndlp parameter. For supported handle types, see the handle table in the Description section. |
| errhp(IN) | The error handle. |
| parmdpp(OUT) | The output descriptor handle. |
| pos(IN) | The position in the descriptor from which the descriptive information is to be obtained. |
Return value : OCI_SUCCESS is returned if the function call succeeded, or OCI_ERROR is returned if the function call failed.
Description : The following table describes the parameter handles that can be obtained by calling the OCIParamGet() function.
Handle |
Description |
|---|---|
| OCI_HTYPE_STMT | The statement handle. |
| OCI_DTYPE_PARAM | The parameter handle. |
