SQLFetchActivatesBuffer Command
Obsolete
Refer to the SQLFetchActivatesBuffer method in the cSQLStatement class.
SQLFetchActivatesBuffer hstmt FileNumber|FileName bState
The SQLFetchActivatesBuffer command can be used to connect a buffer's status to Embedded SQL. Normal execution of Embedded SQL will never set the buffer status to active. By using this command, this link can be provided.
It is possible to link multiple buffers to one statement by subsequently issuing SQLFetchActivatesBuffer statements for every buffer to link. Linked buffers can be removed from a statement by passing false; when passing true, the buffer will be added to the statement.
The Embedded SQL engine adjusts the status of all linked file buffers automatically directly after the fetch inside a SQLFetch or SQLFileFetch command. The status is set to active if the fetch was successful; otherwise, the status is not adjusted.
Warning: Linking buffers will negatively affect optimization of the Find logic within the driver. It is recommended to only link buffers when needed and unlink as soon as possible.
Open Customer
SQLFileConnect Customer To hdbc
SQLOpen hdbc To hstmt
SQLExecDirect hstmt "SELECT * FROM Customer WHERE City = 'Amsterdam'"
SQLFetchActivatesBuffer hstmt Customer True
Repeat
SQLFileFetch hstmt To Customer
If (SQLResult) Begin
Reread Customer
Move "(+31) 020" To Customer.AreaCode
Saverecord Customer
Unlock
End
Until (Not(SQLResult))
SQLFetchActivatesBuffer hstmt Customer False