AppendChunk Method
Applies To
OField
Description
This method appends data to a long or long raw field.
Usage
oresult AppendChunk(const void *chunkp, unsigned short numbytes)
Arguments
chunkp A pointer to the data to append.
numbytes The number of bytes from chunkp to append.
Remarks
Long and long raw columns in an Oracle database can hold large amounts of
data. The AppendChunk method enables you to add data to a long field piecewise. You can add a
maximum of 64K at once. Each call to AppendChunk adds data following any other calls. AppendChunk calls must be made while the dynaset is in an editing mode started by either StartEdit, AddNewRecord, or DuplicateRecord. This method is valid only for fields with server types of OTYPE_LONG or
OTYPE_LONGRAW.
Return Value
An oresult indicating whether the operation succeeded (OSUCCESS) or not
(OFAILURE).
Example
This example adds take an image segmented into several chunks and stores it in
the database.
// we have an open dynaset pictdyn
// get an OField on the "picture" field of the dynaset
OField pictfield = pictdyn.GetField();
// now start editing
pictdyn.StartEdit();
// and loop through the chunks of the picture
int ii;
for (ii=0; ii<nchunks; ii++)
pictfield.AppendChunk((const void *) picture[ii], plen[ii]);
// and save it to the database
pictdyn.Update();