Skip Headers
Oracle® Objects for OLE C++ Class Library Developer's Guide
10g Release 2 (10.2)

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

Write Method

Applies To

OBlob

OClob

Description

Writes a buffer into the OBlob or OClob value of this object and returns the total amount of the data written, in bytes for OBlob objects, and characters for OClob objects.

Usage

unsigned long Write(short *status, unsigned char *buffer, unsigned long buffersize, unsigned char piecetype = OLOB_ONE_PIECE, unsigned long offset = 0) const throw(OException)

unsigned long Write(unsigned char *buffer, unsigned long buffersize, unsigned char piecetype = OLOB_ONE_PIECE, unsigned long offset = 0) const throw(OException)

Arguments

Arguments
Description
status Status of the current operation. Possible return values are:
  • OLOB_NEED_DATA - There is more data to be written
  • OLOB_NODATA - There is no data to be written usually due to an error condition
  • OLOB_SUCCESS - Data written successfully
buffer Pointer to user-supplied buffer.
buffersize Size of the buffer. This is the number of bytes that will be written.
piecetype An integer specifying which piece of the buffer is being written. Possible values include:
  • OLOB_ONE_PIECE - buffer will be written in a single piece. This is the default.
  • OLOB_FIRST_PIECE - buffer represents the piece of LOB data to be written.
  • OLOB_NEXT_PIECE - buffer represents the next piece of LOB data to be written.
  • OLOB_LAST_PIECE - buffer represents the last piece of LOB data to be written.
offset 1-based offset, in bytes, into the LOB to indicate where the writing will begin. The default value of zero causes the write to start at the beginning of the LOB in non-streaming mode or the value passed to EnableStreaming when in streaming mode.

Remarks

Either a row-level lock or object-level lock should be obtained before calling this method.

This method writes the LOB data from the offset and returns the number of bytes (Blobs/Bfiles) or characters (Clobs) written.

See the Remarks for EnableStreaming. See GetOptimumChunkSize for additional comments.

Examples

Example: Writing a Blob

Example: Writing a Clob