Skip Headers

Oracle® Objects for OLE Developer's Guide
10g Release 1 (10.1)

Part Number B10118-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Master Index
Master Index
Go to Feedback page
Feedback

Write (OraLOB) Method

Applies To

OraBLOB, OraCLOB

Description

Writes a buffer into the BLOB or CLOB value of this object and returns the total amount of the data written.

Arguments
Description
[in] buffer
The character array for OraClob or byte array for OraBlob from which the piece will be written.
[in] [optional] chunksize
An Integer specifying the length of the buffer in characters for OraCLOB and bytes for OraBLOB/OraBFile. Default value is the size of the buffer argument.
[in] [optional] piece
An Integer specifying which piece of the buffer is being written. Possible values include:
· ORALOB_ONE_PIECE - buffer will be written in a single piece. This is the default.
· ORALOB_FIRST_PIECE - buffer represents the piece of LOB data to be written
· ORALOB_NEXT_PIECE - buffer represents the next piece of LOB data to be written
· ORALOB_LAST_PIECE - buffer represents the last piece of LOB data to be written
[out] amount_written
an integer representing the amount written, in characters for OraClob and bytes for OraBlob/OraBFile.
Usage

amount_written = OraBlob.Write buffer, chunksize, piece

amount_written = OraClob.Write buffer, chunksize, piece

Remarks

Either a row-level lock or object-level lock should be obtained before calling this method. This method writes the BLOB/CLOB data from the offset specified by the Offset property. For a multiple piece write operation, the PollingAmount property can be set to the value of total amount of data to be written and the Status property must be checked for the success of each piece operation. If the total amount is not known, PollingAmount may be set to 0 and polling will still occur as long as the piece type is not OraLob_piece.

For the last piece, set the piece argument to ORALOB_LAST_PIECE. You must write the polling amount in bytes or characters. It is not possible to terminate the write operation early if PollingAmount is nonzero.

When OraLob.Pollingamount = 0 but piecetype on OraLob.Write is not ORALOB_ONE_PIECE, polling still occurs. Polling completes when ORALOB_LAST_PIECE is sent as an argument to a call to Write. This is especially useful when calling OraCLOB.Write in a varying width character set when counting the total amount of characters ahead of time may be costly.

Note: When manipulating LOBs using LOB methods, such as the Write and CopyFromFile, the LOB object will not automatically be trimmed if the length of the new data is smaller than the old data. Use the Trim (OraLob) method to shrink the LOB object to the size of the new data.

Examples

Example: Multiple piece-wise Write of a LOB

Example: Single piece Write of a LOB