Consultor Eletrônico



Kbase P15498: Error 995 with TEMP-TABLEs and -cache parameter
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   16/10/2008
Status: Unverified

SYMPTOM(s):

Error 995 running a program.

Index  is inactive and cannot be referenced. (995)

Occurs in an internal procedure of a persistent procedure.

One of the parameters of the internal procedure is a BUFFER parameter for a TEMP-TABLE.

TEMP-TABLE is defined LIKE a database table.

Database where the template database table resides was connected with the -cache parameter.

CAUSE:

This is a known issue.

It can be reproduced with the following piece of code:

/* main.p */
DEF VAR pp AS HANDLE.

DEF TEMP-TABLE tCust LIKE customer.

RUN persist.p PERSISTENT SET pp.
RUN problem IN pp (BUFFER tCust).


/* persist.p */
DEF TEMP-TABLE tCust LIKE customer.

PROCEDURE problem:
DEF PARAMETER BUFFER bCust FOR tCust.

FIND FIRST bCust.
END.

As stated in the Symptoms, this only happens if you connect to the database where the customer table is defined with the -cache parameter.

FIX:

The problem is restricted to this very corner case and can be worked around by changing anything of the aforementioned Symptoms.
The easiest workaround is probably to avoid connecting to the database with the -cache option; otherwise the BUFFER parameter can be changed to a HANDLE parameter as in the following:

/* main.p */
DEF VAR pp AS HANDLE.

DEF TEMP-TABLE tCust LIKE customer.

RUN persist.p PERSISTENT SET pp.
RUN noProblem IN pp (TEMP-TABLE tCust:DEFAULT-BUFFER-HANDLE).


/* persist.p */
DEF TEMP-TABLE tCust LIKE customer.

PROCEDURE noProblem:
DEF INPUT PARAMETER bCust AS HANDLE.

bCust:FIND-FIRST().
END.