SQL_SET_CHUNK_SIZE¶

Applies to: SQLFlex

This command sets the size of the chunk to retrieve when using SQL_GET_DATA_CHUNK_EX. Whatever number is set here will be the length of the chunk that is retrieved, as long as it does not exceed the maximum data size setting (set using SQL_SET_MAX_DATA_SIZE).

Syntax

SQL_SET_CHUNK_SIZE to {variable}

Parameter

Description

variable

Length of chunk to retrive

Example

SQL_SET_MAX_DATA_SIZE to |CI$4000000 //(64MB)
move |CI$80000 to iChunkSize // 512KB
SQL_SET_CHUNK_SIZE to iChunkSize

SQL_SET_STMT to "SELECT * FROM CUSTOMER WHERE STATUS = 'Active' "
SQL_PREPARE_STMT
SQL_EXECUTE_STMT
SQL_FETCH_NEXT_ROW into sID sBio
If (Found) Begin
    SQL_GET_COLUMN_DATA_SIZE COLUMN 6 to iDataSize

    Repeat
        SQL_GET_DATA_CHUNK COLUMN 6 OFFSET iProgress to sChunk
        ADD iChunkSize to iProgress
        write sChunk
    until (iProgress >= iDataSize)

End