|
<< Click to Display Table of Contents >> DbiPutBlob |
![]() ![]()
|
C syntax
DBIResult DBIFN DbiPutBlob (hCursor, pRecBuf, iField, iOffSet, iLen, pSrc);
Delphi syntax
function DbiPutBlob (hCursor: hDBICur; pRecBuf: Pointer; iField: Word; iOffSet: Longint; iLen: Longint; pSrc: Pointer): DBIResult stdcall;
Description
DbiPutBlob writes data into an open BLOB field.
Parameters
hCursor Type: hDBICur (Input)
Specifies the cursor handle.
pRecBuf Type: pBYTE (Input)
Pointer to the record buffer.
iField Type: UINT16 (Input)
Specifies the ordinal number of a BLOB field within the record buffer.
iOffSet Type: UINT32 (Input)
Specifies the starting position, offset from the beginning of the BLOB, where the data is to be written. This value must not exceed the length of the BLOB. Valid values of iOffset range from 0 to the BLOB field's length. If iOffset is less than the BLOB field's length, part of the existing BLOB field is overwritten. If iOffset is equal to the length of the BLOB field, the data is appended to the existing BLOB field.
If the BLOB field also has a BLOB header (BLOB tuple area), and iOffset falls within that header area, the information in the tuple is also updated when DbiModifyRecord, DbiAppendRecord, or DbiInsertRecord is called.
iLen Type: UINT32 (Input)
Specifies the number of bytes to write to the BLOB field. iLen can be greater than 64K.
pSrc Type: pBYTE (Input)
Pointer to the data to be written to the BLOB field.
Usage
The block of data supplied in pSrc is transferred to the BLOB field, based on the values specified in iOffset and iLen. DbiPutBlob can access data in blocks larger than 64Kb, depending on the size you allocate for the buffer.
| Note: | This does not update the underlying table. The client application must call DbiAppendRecord, DbiModifyRecord, or DbiInsertRecord, using this record buffer, to update the table with the BLOB field. |
Prerequisites
The BLOB field must be opened in read-write mode.
Completion state
Performs the equivalent of DbiPutField, for a BLOB field.
DbiResult |
Meaning |
DBIERR_NONE |
The data was successfully written to the BLOB field. |
DBIERR_BLOBNOTOPENED |
The specified BLOB field was not opened via a call to DbiOpenBlob. |
DBIERR_INVALIDBLOBHANDLE |
The record buffer supplied contains an invalid BLOB handle. |
DBIERR_NOTABLOB |
The specified field number does not correspond to a BLOB field. |
DBIERR_INVALIDBLOBOFFSET |
The specified iOffSet is greater than the length of the BLOB field. |
DBIERR_READONLYFLD |
The BLOB field was opened in dbiREADONLY mode and cannot be modified. |
See also
DbiAppendRecord, DbiModifyRecord, DbiInsertRecord, DbiGetBlob, DbiOpenBlob, DbiTruncateBlob, DbiFreeBlob, DbiGetBlobSize