1

使用 Openedge 11.2 版和 Progress Developer Studio。

我正在使用几个 TEMP-TABLE 定义(每个都在一个单独的包含文件中)来形成一个数据集。如果我只对单个数据关系使用一对 RELATION-FIELDS,一切看起来都很好。一旦我将另一个关系字段对添加到定义中并将包含文件放在表单上(或通过“从文件导入架构”按钮导入架构),数据集就会显示一个没有列的重复子表。为了简单起见和测试,我设置了三个测试文件:

tt1.i - 第一个临时表:

/* 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 - 第二个临时表:

/* 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 */

{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
).

当我将 dsTest.i 放在表单上时会发生什么的打印屏幕:

两个子表

如果我删除第二对,一切正常 - GUI 明智。我在这里遗漏了一些明显的东西吗?到目前为止,我发现的所有示例都使用单个 RELATION-PAIR。现在我想知道为什么。根据 Progress Knowledgebase 文章000018088,不涉及巫术。

4

1 回答 1

2

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?

于 2013-07-12T08:28:08.307 回答