#docslug#/obci/obci/V2.0.1/wbz81w
OCILobGetLength
Description : You can call this function to return the length of a large object (LOB) in bytes.
Function prototype :
sword OCILobGetLength (
OCISvcCtx *svchp,
OCIError *errhp,
OCILobLocator *locp,
ub4 *lenp );
Parameters :
Parameter |
Description |
|---|---|
| svchp(IN) | A pointer to a service context handle. |
| errhp(IN/OUT) | An error handle. |
| locp(IN) | A pointer to an LOB locator. |
| lenp(OUT) | Returns the length of an LOB, in bytes. |
Return value : OCI_SUCCESS if succeeded, or OCI_ERROR if failed.
OCILobRead
Description : You can call this function to read the content of a specified length from an LOB.
Function prototype :
sword OCILobRead (
OCISvcCtx *svchp,
OCIError *errhp,
OCILobLocator *locp,
ub4 *amtp,
ub4 offset,
dvoid *bufp,
ub4 bufl,
dvoid *ctxp,
OCICallbackLobRead (cbfp)
( dvoid *ctxp,
CONST dvoid *bufp,
ub4 len,
ub1 piece
)
ub2 csid,
ub1 csfrm );
Parameters :
Parameter |
Description |
|---|---|
| svchp(IN) | A pointer to a service context handle. |
| errhp(IN/OUT) | An error handle. |
| locp(IN) | A pointer to an LOB locator. |
| Amtp(IN/OUT) | This parameter indicates the amount of input or output bytes. When the function is called, this parameter indicates the number of bytes to be read. Upon the end of function execution, OBCI backfills the number of bytes that was actually read. |
| offset | A reserved parameter. |
| bufp(IN) | The pointer to the buffer that stores the data read. |
| bufl(IN) | The length of the buffer that stores the data read. |
| ctxp | A reserved parameter. |
| cbfp | A reserved parameter. |
| csid | A reserved parameter. |
| csfrm | A reserved parameter. |
Return value : OCI_NEED_DATA if the execution was successful, but not all data was read. OCI_SUCCESS if succeeded. OCI_ERROR if failed.
OCILobWrite
Description : You can call this function to continuously write content into an LOB.
Function prototype :
sword OCILobWrite (
OCISvcCtx *svchp,
OCIError *errhp,
OCILobLocator *locp,
ub4 *amtp,
ub4 offset,
void *bufp,
ub4 buflen,
ub1 piece,
void *ctxp,
OCICallbackLobWrite (cbfp)
(
void *ctxp,
void *bufp,
ub4 *lenp,
ub1 *piecep
)
ub2 csid,
ub1 csfrm );
Parameters :
Parameter |
Description |
|---|---|
| svchp(IN) | A pointer to a service context handle. |
| errhp(IN/OUT) | An error handle. |
| locp(IN) | A pointer to an LOB locator. |
| amtp(IN/OUT) | This parameter indicates the amount of input or output bytes. When the function is called, this parameter indicates the number of bytes to be read. Upon the end of function execution, OBCI backfills the number of bytes that was actually read. |
| offset | A reserved parameter. |
| bufp(IN) | The pointer to the buffer that stores the data read. |
| buflen(IN) | The length of the buffer that stores the data read. |
| piece | A reserved parameter. |
| ctxp | A reserved parameter. |
| cbfp | A reserved parameter. |
| csid | A reserved parameter. |
| csfrm | A reserved parameter. |
Return value : OCI_SUCCESS if succeeded, or OCI_ERROR if failed.
OCILobLocatorIsInit
Description : You can call this function to verify whether the given LOB or BFILE locator is initialized.
Function prototype :
sword OCILobLocatorIsInit (
OCIEnv *envhp,
OCIError *errhp,
const OCILobLocator *locp,
boolean *is_initialized );
Parameters :
Parameter |
Description |
|---|---|
| svchp(IN/OUT) | A pointer to a service context handle. |
| errhp(IN/OUT) | An error handle. |
| locp(IN) | An LOB or BFILE locator. |
| is_initialized (OUT) | Returns TRUE if the given LOB or BFILE locator is initialized, and FALSE if it is not. |
Return value : OCI_SUCCESS if succeeded, or OCI_ERROR if failed.
OCILobOpen
Description : You can call this function to open an LOB or BFILE object.
Function prototype :
sword OCILobOpen (
OCISvcCtx *svchp,
OCIError *errhp,
OCILobLocator *locp,
ub1 mode );
Parameters :
Parameter |
Description |
|---|---|
| svchp(IN) | A pointer to a service context handle. |
| errhp(IN/OUT) | An error handle. |
| locp(IN/OUT) | An LOB or BFILE locator. |
| mode (IN) | The mode of the operation. |
Return value : OCI_SUCCESS if succeeded, or OCI_ERROR if failed.
OCILobClose
Description : You can call this function to close an LOB or BFILE object.
Function prototype :
sword OCILobClose ( OCISvcCtx *svchp,
OCIError *errhp,
OCILobLocator *locp );
Parameters :
Parameter |
Description |
|---|---|
| svchp(IN) | A pointer to a service context handle. |
| errhp(IN/OUT) | An error handle. |
| locp(IN/OUT) | An LOB or BFILE locator. |
Return value : OCI_SUCCESS if succeeded, or OCI_ERROR if failed.
OCILobIsOpen
Description : You can call this function to test whether an LOB or FILE object is open.
Function prototype :
sword OCILobIsOpen (
OCISvcCtx *svchp,
OCIError *errhp,
OCILobLocator *locp,
boolean *flag );
Parameters :
Parameter |
Description |
|---|---|
| svchp(IN) | A pointer to a service context handle. |
| errhp(IN/OUT) | An error handle. |
| locp(IN) | An LOB or FILE handle. |
| flag(OUT) | Returns TRUE if the LOB or FILE is open, or FALSE if otherwise. |
Return value : OCI_SUCCESS if succeeded, or OCI_ERROR if failed.
OCILobTrim
Description : You can call this function to trim the LOB value to a shorter length.
Function prototype :
sword OCILobTrim (
OCISvcCtx *svchp,
OCIError *errhp,
OCILobLocator *locp,
ub4 newlen );
Parameters :
Parameter |
Description |
|---|---|
| svchp(IN) | A pointer to a service context handle. |
| errhp(IN/OUT) | An error handle. |
| locp(IN) | An LOB or FILE handle. |
| newlen(IN) | The new length of the LOB value, which must be shorter than or equal to the current length. For character LOBs, it indicates the number of characters, and for binary LOBs and BFILEs, it indicates the number of bytes in an LOB. |
Return value : OCI_SUCCESS if succeeded, or OCI_ERROR if failed.
OCILobTrim2
Description : You can call this function to trim the LOB value to a shorter length. This function must be used for LOBs that are greater than 4 GB. You can also use this function for LOBs that are smaller than 4 GB.
Function prototype :
sword OCILobTrim2 (
OCISvcCtx *svchp,
OCIError *errhp,
OCILobLocator *locp,
ub4 newlen );
Parameters :
Parameter |
Description |
|---|---|
| svchp(IN) | A pointer to a service context handle. |
| errhp(IN/OUT) | An error handle. |
| locp(IN) | An LOB or FILE handle. |
| newlen(IN) | The new length of the LOB value, which must be shorter than or equal to the current length. For character LOBs, it indicates the number of characters, and for binary LOBs and BFILEs, it indicates the number of bytes in an LOB. |
Return value : OCI_SUCCESS if succeeded, or OCI_ERROR if failed.
