DbiTruncateBlob

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

DbiTruncateBlob

Return to chapter overview

C syntax

DBIResult DBIFN DbiTruncateBlob (hCursor, pRecBuf, iField, iLen);

Delphi syntax

function DbiTruncateBlob (hCursor: hDBICur; pRecBuf: Pointer; iField: Word; iLen: Longint): DBIResult stdcall;

Description

DbiTruncateBlob is used to shorten the size of the contents of a BLOB field, or to delete the contents of a BLOB field from the record, by shortening it to zero.

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 BLOB field within the record buffer.

iLen                Type: UINT32                (Input)
Specifies the new shorter length of the BLOB. If zero is specified, the whole BLOB is truncated.

Usage

This is the only way to delete a BLOB without deleting the entire record.

Standard, Access: It is advisable to lock the record before opening the BLOB in read-write mode to ensure that another client application does not lock the record.

Prerequisites

The current record must contain a BLOB field. The BLOB field must be open in dbiREADWRITE mode by a call to DbiOpenBlob.

Completion state

After shortening the BLOB field, DbiModifyRecord must be called to post the altered record to the table.

DbiResult

Meaning

DBIERR_NONE

The BLOB field was successfully truncated.

DBIERR_BLOBNOTOPENED

The specified BLOB field was not opened via a call to DbiOpenBlob.

DBIERR_INVALIDBLOBHANDLE

The BLOB handle supplied in the record buffer is invalid.

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

DbiGetBlob, DbiOpenBlob, DbiPutBlob, DbiFreeBlob, DbiModifyRecord