1
votes

Using Openedge version 11.2 & Progress Developer Studio.

I'm using several TEMP-TABLE definitions (each in a separate include file) to form a DataSet. Everything looks OK if I use only one pair RELATION-FIELDS for a single data relation. As soon as i add another RELATION-FIELDS pair to the definition and drop the include file on the form (or import the schema via "Import Schema from File" button) the DataSet shows a duplicate child table with no columns. For simplicity sake and testing, I've set up three test files :

tt1.i - First TEMP-TABLE:

/* Temp Table 1 */
DEFINE TEMP-TABLE tt1
  FIELD tt_test AS CHARACTER
  FIELD tt_rel_field_1 AS INTEGER
  FIELD tt_rel_field_2 AS INTEGER
  INDEX tt_idx tt_rel_field_1 tt_rel_field_2.

tt2.i - Second TEMP-TABLE:

/* Temp Table 2 */

DEFINE TEMP-TABLE tt2
  FIELD tt_test2 AS CHARACTER
  FIELD tt_rel_field_1 AS INTEGER
  FIELD tt_rel_field_2 AS INTEGER
  INDEX tt_idx tt_rel_field_1 tt_rel_field_2.

dsTest.i - Dataset definition:

/* Dataset Definition */

{tt1.i}
{tt2.i}

DEFINE DATASET dsTest FOR tt1 , tt2
  DATA-RELATION drTest FOR tt1 , tt2
  RELATION-FIELDS (
  tt_rel_field_1,tt_rel_field_1,
  tt_rel_field_2,tt_rel_field_2
).

Printscreen of what happens when i drop dsTest.i on the form :

Two child tables

If I remove the second pair, everything works fine - GUI wise. Am I missing something obvious here ? All the examples I've found so far all use a single RELATION-PAIR. Now I wonder why. According to Progress Knowledgebase article 000018088 there is no voodoo involved.

1
I see your TT defs don't include indexes - try adding an appropriate index to your TT defs and see what happens. - Tim Kuehn
@TimKuehn I've added indexes (also edited my original post), but the result is the same. Thx for the tip ...didn't pay attention to it, since my production temp tables have indexes set. - Corwin

1 Answers

2
votes

Your syntax looks correct according to the manuals. But the interesting thing is that I do not see any place in our whole environment where we ever use more than 1 relation-field. It may be that it wants to create a relationship for each field you defined.

What does the data look like that you place in your tables? The data must form unique match.

I would ask Tom Bascom for some input on this. https://stackoverflow.com/users/123238/tom-bascom

=============

Page 1-19 of the OpenEdge Development: ProDataSets manual does the following:

DEFINE DATASET dsOrder FOR ttOrder, ttOline, ttItem
      DATA-RELATION OrderLine FOR ttOrder, ttOline
          RELATION-FIELDS (OrderNum, OrderNum)
      DATA-RELATION LineItem FOR ttOline, ttItem
          RELATION-FIELDS (ItemNum, ItemNum).   

Sorry not sure how to do formatting here, but maybe test it with creating another table as a link between the two?