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 » ULColumn class

AppendStringChunk method Next Page

GetByteChunk method


Gets data from a TypeBinary or TypeLongBinary column.

Syntax

GetByteChunk ( _
offset As Long, _
data As Long, _
data_len As Long, _
filled_len As Long _
) As Boolean
Member of UltraLiteAFLib.ULColumn

Parameters

offset    The offset into the underlying array of bytes. The source offset must be greater than or equal to 0, otherwise a ulSQLE_INVALID_PARAMETER error is raised.

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    This is an OUT parameter. After the method is called, it indicates how many bytes were fetched with valid data. If the size of BLOB data is unknown in advance, it is fetched using a fixed-length chunk - one chunk at a time. The last chunk fetched can be smaller than chunk size, so filled_len informs how many bytes of valid data exist in the buffer.

Returns

True if this column value contains more data.

False if there is no more data for this column in the database.

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.

'MobileVB using VB6
Dim filled As Long
Dim more_data As Boolean
Dim data (1 to 512) As Byte
more_data = table.Column("edata").GetByteChunk(0, _
VarPtr(data(1)), 512, filled)
'Crossfire using vb.net
Dim filled As Long
Dim more_data As Boolean
Dim data (1 to 512) As Byte
more_data = table.Column("edata").GetByteChunk(0, _
data, 512, filled)