Oracle Objects for OLE
Release 8.1.7

Part Number A85257-01

Library

Product

Contents

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

[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 bytes. 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
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 must 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. For the last piece, set the piece argument to ORALOB_LAST_PIECE. Note that you must write the polling amount in bytes or characters. It is not possible to terminate the write operation early.

Note: When manipulating LOBs using LOB methods, such as the Write and CopyFromFile, note that 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


 
Oracle
Copyright copy; 1996-2000, Oracle Corporation.

All Rights Reserved.

Library

Product

Contents