Consultor Eletrônico



Kbase 18448: Why A Newly Created Record May Not Be Found Immediately
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   27/10/2008
Status: Verified

CAUSE:

When you create a record and then immediately read it with a BREAK BY, Progress will not find the record because the indexes have not yet been written.

The indexing action occurs separately from the create of the record.

In the procedure editor, enter the following code:


/* Part 1 */
DEFINE TEMP-TABLE temp
FIELD c1 AS CHAR
    FIELD c2 AS CHAR
    INDEX ix1 c1 c2.

/* Part 2 */
FOR EACH customer WHERE customer.cust-num = 1:
RUN proc1.
END.

/* Part 3 */
FOR EACH temp BREAK BY c1:
DISPLAY C1.
END.

/* Part 4 */
PROCEDURE proc1:
CREATE temp.
   ASSIGN c1 = "ok".
END.

When you run this code, you will notice a quick flash and the procedure will do nothing when executed.  

FIX:

Any one of the following will display this temp table's record:

1) Part 1: Remove C2 as part of the index.

2) Part 2: Add a DO TRANSACTION around the FOR EACH, or add a RELEASE temp after the RUN proc1.

3) Part 3: Remove the BREAK BY.

4) Part 4: Add a DO TRANSACTION around CREATE.


FIX:

References to Written Documentation:

Progress Language Reference
Progress Programming Handbook