Consultor Eletrônico



Kbase P13634: FIRST-OF function returns false when temp-table has only a single record
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   5/9/2005
Status: Unverified

FACT(s) (Environment):

Progress 9.x

SYMPTOM(s):

Temp-table contains a single record

Doing a FOR EACH with a BREAK-BY on the temp-table

Testing the BREAK-BY field inside the FOR EACH using the FIRST-OF function returns false

Record is created in the procedure where the FOR EACH is executed

CAUSE:

Index keys for the temp-table record have not yet been written.
Although temp-tables do not require an active transaction to be updated, they will follow the same rules as the transaction mechanism to determine when record validation index keys are written. This keeps the behavior of a temp-table consitstent with that of a database table.

FIX:

Force the index keys to be written in one of the following ways:

- Place a DO TRANSACTION block around the CREATE/ASSIGN for the temp-table
- Issue a RELEASE for the buffer after the record is created
- Issue a VALIDATE for the buffer after the record is created