Clean up dynamic buffers
- Last Updated: October 15, 2024
- 2 minute read
- OpenEdge
- Version 12.8
- Documentation
|
Given that the table name is known and that it is, therefore, a literal in the
CREATE BUFFER statement, there is no particular advantage to doing
this. The CREATE BUFFER statement is better used when the buffer name
is variable.
When you create dynamic buffers, rather than just using handles to static buffers, you
need to delete them when you’re done using them, just as with other objects. You use the
same DELETE OBJECT statement to do this.
GET-BUFFER-HANDLE method to determine what
buffers to delete when you have finished with a dynamic query with dynamic buffers, as
in this example:
|
Note that you cannot delete the buffers in the loop where the code uses the
GET-BUFFER-HANDLE() method at the end of the procedure because
deleting the buffers would un-prepare the query and cause it to lose the list of buffers
before you had retrieved them all. Thus, you need to build a comma-separated list of
buffer handles and walk through the list afterwards to delete the buffers, and then
delete the query.