Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » UltraLite - AppForge Programming » UltraLite for AppForge API Reference » ULResultSet class

GetByte method Next Page

GetByteChunk method


Fills the buffer passed in (which should be an array) with the binary data in the column.

Syntax

GetByteChunk ( _
index As Integer, _
src_offset As Long, _
data As Long, _
data_len As Long, _
filled_len As Long _
) As Boolean
Member of UltraLiteAFLib.ULResultSet

Parameters

index    The 1-based ordinal of the column containing the binary data.

offset    The offset into the underlying array of bytes. The source offset must be greater than or equal to 0, otherwise a SQLE_INVALID_PARAMETER error is raised. A buffer bigger than 64K is also permissible.

data    A pointer to an array of bytes. To get the pointer to the array of bytes, use the Visual Basic VarPtr() function.

data_len    The length of the buffer, or array. The data_len must be greater than or equal to 0.

filled_len    The number of bytes fetched. Because you do not know how big the BLOB data is in advance, you generally fetch it using a fixed-length chunk, one chunk at a time. The last chunk may be smaller than your chunk size. filled_len reports how many bytes were actually fetched.

Returns

The number of bytes read.

Remarks

This method throws an error if the underlying column is NULL. Applications should first check for a NULL value in the property or method.

This method is suitable for BLOBs.

Errors set

ulSQLE_CONVERSION_ERROR    This error occurs if the column data type is not BINARY or LONG BINARY.

ulSQLE_INVALID_PARAMETER    This error occurs if the column data type is BINARY and the offset is not 0 or 1, or, the data length is less than 0.

The error also occurs if the column data type is LONG BINARY and the offset is less than 1.

Example

In the following example, edata is a column name. If the data_len parameter passed in is not sufficiently long, the entire application terminates.

Dim data (512) As Byte
...
table.Column("edata").GetByteChunk(0,data)