Feedback
 
Did this article resolve your question/issue?

   

Your feedback is appreciated.

Please tell us how we can make this article more useful. Please provide us a way to contact you, should we need clarification on the feedback provided or if you need further assistance.

Characters Remaining: 1025

 


Article

Indexes inherited when defining TEMP-TABLE LIKE another TEMP-TABLE and using INDEX option

« Go Back

Information

 
Article Number000034626
EnvironmentProgress\OpenEdge Versions
All Supported Operating Systems
ABL
Question/Problem Description
Indexes inherited when defining TEMP-TABLE LIKE another TEMP-TABLE and using INDEX option
Error (132) defining a TEMP-TABLE LIKE another

Steps to Reproduce
Clarifying Information
The INDEX definitions are incorrectly inherited by a TEMP-TABLE defined LIKE another despite the use of the INDEX option in the inheritor TEMP-TABLE definition.    This may result in duplicating index entries and otherwise unexpected errors.

The below code snippet demonstrates this condition:

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.


Error Message** <file-name> already exists with <field/value...>. (132)
Defect/Enhancement NumberDefect OE00095268
Cause

The exact cause is unknown at this time

Resolution

None at this time

Workaround

Use the USE-INDEX option of the LIKE phrase to specify a non-existent index.  This causes the inheritor temp-table to "correctly" omit indices in the original temp-table.

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 /* Note that idx-3 has not
                                                          actually been defined
                                                          anywhere. */

    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.


Notes
Attachment 
Last Modified Date9/13/2015 5:54 AM