Product Documentation

FairCom Direct SQL for C and C++

Previous Topic

Next Topic

ctsqlGetBlob

Retrieve the blob field.

Declaration

CTSQLRET ctsqlGetBlob(pCTSQLCURSOR hCursor, INTEGER colnumber, void* buffer, INTEGER size, INTEGER offset, INTEGER *bytesread)

Description

ctsqlGetBlob() retrieves the value of a blob field, given its cursor and column.

  • hCursor the cursor handle.
  • colnumber the column number.
  • buffer the buffer that will store the field data.
  • size the maximum number of bytes to read.

    Note: For LVARCHAR data, the buffer will always be NULL terminated on return. If ctsqlGetColumnLength() returns 15000 bytes, it is necessary to call ctsqlGetBlob() with size = 15001 to accommodate all 15000 bytes of data. LVARBINARY fields are not NULL terminated.

  • offset the offset in bytes from the beginning of the LVARCHAR or LVARBINARY column to the portion that ctsqlGetBlob() writes to buffer.
  • bytesread return the number of bytes read.

Return

ctsqlGetBlob() returns CTSQLRET_OK on success.

Symbolic Constant

Explanation

SQL_ERR_BADARG

Bad arguments

See Also

ctsqlGetBytes(), ctsqlGetNChar(), ctsqlGetNumeric(), ctsqlGetSmallInt(), ctsqlGetInteger(), ctsqlGetReal(), ctsqlGetFloat(), ctsqlGetDate(), ctsqlGetMoney(), ctsqlGetTime(), ctsqlGetTimeStamp(), ctsqlGetTinyInt(), ctsqlGetBinary(), ctsqlGetBit(), ctsqlGetBigInt()

TOCIndex