Consultor Eletrônico



Kbase P43686: 4GL/ABL: Error (132) defining a TEMP-TABLE LIKE another.
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   8/13/2008
Status: Unverified

SYMPTOM(s):

4GL/ABL: Error (132) defining a TEMP-TABLE LIKE another.

** <file-name> already exists with <field/value...>. (132)

The INDEX definitions are incorrectly inherited by the child TEMP-TABLE defined LIKE another despite the use of the INDEX option in the child TEMP-TABLE definition. For example:
DEFINE TEMP-TABLE tt1 NO-UNDO
FIELD fld-a AS INTEGER
FIELD fld-b AS INTEGER
FIELD fld-c AS INTEGER
FIELD fld-d AS INTEGER
INDEX idx-1 AS PRIMARY UNIQUE fld-a.

DEFINE TEMP-TABLE tt2 NO-UNDO LIKE tt1
FIELD fld-e AS INTEGER
INDEX idx-2 AS PRIMARY UNIQUE fld-e.

CREATE tt2.
ASSIGN
tt2.fld-a = 1
tt2.fld-e = 3.

CREATE tt2.
ASSIGN
tt2.fld-a = 1
tt2.fld-e = 4.

FOR EACH tt2:
DISPLAY tt2.fld-a tt2.fld-e.
END.

FACT(s) (Environment):

All Supported Operating Systems
OpenEdge 10.1x
Progress 9.1x

CAUSE:

Bug# OE00095268

FIX:

None at this time.
As a workaround, use the USE-INDEX option in the definition of the child TEMP-TABLE B with a dummy non-existing index. For example:

DEFINE TEMP-TABLE tt1 NO-UNDO
FIELD fld-a AS INTEGER
FIELD fld-b AS INTEGER
FIELD fld-c AS INTEGER
FIELD fld-d AS INTEGER
INDEX idx-1 AS PRIMARY UNIQUE fld-a.

DEFINE TEMP-TABLE tt2 NO-UNDO LIKE tt1 USE-INDEX idx-3
FIELD fld-e AS INTEGER
INDEX idx-2 AS PRIMARY UNIQUE fld-e.

CREATE tt2.
ASSIGN
tt2.fld-a = 1
tt2.fld-e = 3.

CREATE tt2.
ASSIGN
tt2.fld-a = 1
tt2.fld-e = 4.

FOR EACH tt2:
DISPLAY tt2.fld-a tt2.fld-e.
END.