如何使用联接表定义prodataset

时间:2019-01-30 13:29:30

标签: openedge progress-4gl

您如何实际定义带有联接表的数据集?每当我们这样做时,都会收到错误buffer could only have 1 active parent relation

DEFINE DATASET FOR eOrder, eOrderLine, eProduct
DATA-RELATION r1 for eOrder, eOrderLine
RELATION-FIELDS (OrderID, OrderID)
DATA-RELATIOn r2 for eOrder, eProduct.
RELATION-FIELDS(ProductID, ProductID)

1 个答案:

答案 0 :(得分:2)

您的语法似乎有些偏离。您那里没有数据集名称。语法为:

DEFINE DATASET <DatasetName> FOR...

此外,数据关系r2末尾的句点在关系字段之前结束了该语句。这是一个适用于Sports数据库的示例:

DEFINE TEMP-TABLE eOrder LIKE Order.
DEFINE TEMP-TABLE eOrderLine LIKE Order-Line.
DEFINE TEMP-TABLE eCustomer LIKE Customer.

DEFINE DATASET dsOrder FOR eOrder, eOrderLine, eCustomer
DATA-RELATION r1 for eOrder, eOrderLine
RELATION-FIELDS (Order-Num, Order-Num)
DATA-RELATION r2 for eOrder, eCustomer
RELATION-FIELDS (Cust-Num, Cust-Num).