Writing Buffered Rows
To open an Insert cursor, the OPEN statement creates an insert
buffer. The PUT statement puts a row into this insert buffer. The
buffered rows are inserted into the database table as a block only
when necessary; this process is called flushing the buffer.
The buffer is flushed after any of the following events:
- Buffer is too full to hold the new row at the start of a PUT statement.
- A FLUSH statement executes.
- A CLOSE statement closes the cursor.
- An OPEN statement specifies an already open cursor, closing it before reopening it. (This implicit CLOSE statement flushes the buffer.)
- A COMMIT WORK statement executes.
- Buffer contains BYTE or TEXT data (flushed after a single PUT statement).
If the program terminates without closing an Insert cursor, the buffer remains unflushed. Rows that were inserted into the buffer since the last flush are lost. Do not rely on the end of the program to close the cursor and flush the buffer.