CLOSE QUERY statement
Closes a query that was opened by a previous OPEN QUERY statement.
Syntax
query
ExampleThe
r-clsqry.p
procedure defines a query, q-cust, which it shares withr-query.p
. Each time you choose the Ascending, Descending, or CustNum button, the procedure opens a new query for q-cust. To do this, the procedure must first close an open query for each q-cust. Therefore, the CLOSE QUERY statement is used in the CHOOSE trigger for each of these buttons.
Notes
- If a query is closed, you cannot retrieve any more records for the query.
- Closing a query frees most resources used by the query.
- After you close a query, you can reopen it with the OPEN QUERY statement. However, you cannot reuse the query’s buffers for a different table. For example, a buffer, buff1, is created for the customer table in a DEFINE QUERY or OPEN QUERY for the query, qry1. The query is run and closed. You cannot now DEFINE or OPEN qry1 with buff1 for the item table. You can reuse buffers with CREATE QUERY, but you must re-run QUERY-PREPARE.
- If you do not explicitly close a query, it is closed when another OPEN QUERY statement is executed for the same query name.
See alsoCURRENT-RESULT-ROW function, DEFINE QUERY statement, GET statement, NUM-RESULTS function, OPEN QUERY statement, REPOSITION statement
OpenEdge Release 10.2B
|