Consultor Eletrônico



Kbase P159409: 4GL/ABL: How to set the query CACHE size to 0?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   02/02/2010
Status: Unverified

GOAL:

4GL/ABL: How to set the query CACHE size to 0?

GOAL:

How to force a reread of records by setting the query CACHE size to zero?

GOAL:

How to use the CACHE option of the DEFINE QUERY statement to specify the number of NO-LOCK records the query caches in memory?

GOAL:

How to use the CACHE attribute of a Query object handle to control the number of NO-LOCK records the query holds in memory?

FACT(s) (Environment):

All Supported Operating Systems
Progress 9.x
OpenEdge 10.x

FIX:

One way to force a reread of records is by setting the query CACHE size to zero. This may be done using the CACHE option of the DEFINE QUERY statement or CACHE attribute of a Query object handle.
The following code snippet uses the CACHE option of the DEFINE QUERY statement to set the number of NO-LOCK records the query caches in memory to zero:
DEFINE QUERY qCustomer FOR Customer CACHE 0.
OPEN QUERY qCustomer FOR EACH Customer NO-LOCK.
GET FIRST qCustomer.
MESSAGE Custnum "~t" NAME
VIEW-AS ALERT-BOX INFO BUTTONS OK.

The following code snippet uses the CACHE attribute of a Query object handle to set the number of NO-LOCK records the query caches in memory to 1000:
DEFINE VARIABLE hQuery AS HANDLE NO-UNDO.
CREATE QUERY hQuery.
hQuery:CACHE = 1000.
hQuery:SET-BUFFERS(BUFFER Customer:HANDLE).
hQuery:QUERY-PREPARE("FOR EACH Customer NO-LOCK").
hQuery:QUERY-OPEN.
hQuery:GET-NEXT().
MESSAGE Custnum "~t" NAME
VIEW-AS ALERT-BOX INFO BUTTONS OK.