SQL_GET_LOB_CHUNK¶

Applies to: ORAFlex SQLFlex MYSQLFlex PGFlex DB2Flex

This command is used for getting a chunk of data from a specified LOB field. The difference between this command and SQL_GET_LOB is only that the parameters OFFSET and LENGTH are not optional when using this command. You may consider using this command to retrieve small portions of a very large BLOB so as to reduce memory usage.

Syntax

SQL_GET_LOB_CHUNK {FileName.FieldName} TO {variable} OFFSET {offset} LENGTH {length}

Parameter

Description

FileName

The name of the file that contains the specified LOB field

FieldName

The name of the LOB field

variable

The variable to hold the LOB chunk

offset

Integer amount to offset when getting the LOB chunk

length

Length of chunk to get from the LOB field

Example

Set_Argument_Size 262144
String sResult

Move 262144 to iChunkSize
Move 0      to iChunk

Clear Customer
   Move iID to Customer.ID
Find Eq Customer by Index.1
If (Found) Begin
   SQL_GET_LOB_LENGTH Customer.Comments to iLength
   While (iChunk*iChunkSize < iLength)
      SQL_GET_LOB_CHUNK Customer.Comments to sResult OFFSET (iChunk*iChunkSize) LENGTH iChunkSize
      // Do something with the LOB data
      Increment iChunk
   Loop
End