SQL_SAVE_BUFFER

Applies to: ORAFlex SQLFlex MYSQLFlex PGFlex DB2Flex

This command is used to send a record to the “Save Record” buffer. It must be used along with SQL_SAVE_BUFFER_BEGIN and SQL_SAVE_BUFFER_END. SQL_SAVE_BUFFER_BEGIN sets the number of records to store in the buffer before a save is done on all the records at once. Each time a record is created, this command should be called to insert it into the buffer. Using this set of commands can be useful to efficiently save a large number of records. Once the buffer is full, the save occurs automatically and the buffer will be emptied out. It is good practice to use this method inside of a transaction to maintain atomicity.

Syntax

SQL_SAVE_BUFFER of {FileName}

Parameter

Description

FileName

Name of the file

Example

Open Customer

SQL_SAVE_BUFFER_BEGIN of Transactions to 10

For i from 0 to 1000
    Move i to Transactions.ID
    SQL_SAVE_BUFFER of Transactions
Loop

SQL_SAVE_BUFFER_END of Customer