|Oracle Call Interface Programmer's Guide
Part Number A89857-01
More OCI Relational Functions, 9 of 97
Copies all or a portion of a LOB value into another LOB value
sword OCILobCopy ( OCISvcCtx *svchp, OCIError *errhp, OCILobLocator *dst_locp, OCILobLocator *src_locp, ub4 amount, ub4 dst_offset, ub4 src_offset );
The service context handle.
An error handle you can pass to
OCIErrorGet() for diagnostic information in the event of an error.
An internal LOB locator uniquely referencing the destination LOB. This locator must be a locator that was obtained from the server specified by
An internal LOB locator uniquely referencing the source LOB. This locator must be a locator that was obtained from the server specified by
The number of characters for
NCLOBs or bytes for
BLOBs to be copied from the source LOB to the destination LOB.
This is the absolute offset for the destination LOB. For character LOBs it is the number of characters from the beginning of the LOB at which to begin writing. For binary LOBs it is the number of bytes from the beginning of the LOB from which to begin writing. The offset starts at 1.
This is the absolute offset for the source LOB. For character LOBs it is the number of characters from the beginning of the LOB, for binary LOBs it is the number of bytes. Starts at 1.
Copies all or a portion of an internal LOB value into another internal LOB as specified. The data is copied from the source to the destination. The source (
src_locp) and the destination (
dst_locp) LOBs must already exist.
If the data already exists at the destination's start position, it is overwritten with the source data. If the destination's start position is beyond the end of the current data, zero-byte fillers (for
BLOBs) or spaces (for
CLOBs) are written into the destination LOB from the end of the current data to the beginning of the newly written data from the source. The destination LOB is extended to accommodate the newly written data if it extends beyond the current length of the destination LOB. It is an error to extend the destination LOB beyond the maximum length allowed (i.e., 4 gigabytes) or to try to copy from a NULL LOB.
Both the source and the destination LOB locators must be of the same type (i.e., they must both be
BLOBs or both be
CLOBs). LOB buffering must not be enabled for either locator.
This function does not accept a FILE locator as the source or the destination.
It is not mandatory that you wrap this LOB operation inside the Open/Close calls. If you did not open the LOB prior to performing this operation, then the functional and domain indexes on the LOB column are updated during this call. However, if you did open the LOB prior to performing this operation, then you must close it before you commit or rollback your transaction. When an internal LOB is closed, it updates the functional and domain indexes on the LOB column.
If you do not wrap your LOB operations inside the Open/Close API, then the functional and domain indexes are updated each time you write to the LOB. This can adversely affect performance. If you have functional or domain indexes, we recommend that you enclose write operations to the LOB within the open/close statements.