是否可以在 Progress-4GL 中两次从同一个 table 获取信息?

Is it possible to get information from the same table twice in Progress-4GL?

我需要在两个实例中从 table 获取数据。我正在将 Oracle SQL 转换为 Progress,代码如下所示:

 select item.id,structure.group, item2.id
 from item,structure,item item2 
 where item.id = structure.id and structure.sub_id = item2.id (+)

我认为最好的办法是创建一个 temp-table tt-item,我将在其中存储 item 的值,然后在查询中使用外连接来获取结果,一些东西喜欢

DEFINE QUERY qItem FOR item,structure,tt-item.

这是最好的方法吗?有没有更好、更复杂的方法来做到这一点,这样我就不需要复制项目 table,因为它有很多数据并且可能会使加载两次非常慢? 我在网上搜索过这个,没有找到。

您还可以定义缓冲区。这就像第二个记录指针。

DEFINE BUFFER item2 FOR item. 
DEFINE QUERY qItem FOR item, structure, item2.

A temp-table 需要预先填充。数据库 table 上的缓冲区按需填充更多。