从临时表填充浏览器中的数据?

发布于 2025-01-08 21:58:35 字数 990 浏览 0 评论 0原文

我创建了一个动态临时表和动态查询。现在我想将其填充到浏览中。这是我的代码。我的问题是它显示错误,例如“缓冲区复制语句的源元素没有记录(5365)” 。 怎么解决这个问题呢? cip-tablename = 从 UI 获取的表名

CREATE BUFFER hBuffer FOR TABLE cip-tablename.


CREATE QUERY hQuery.        /*this query I need for some other logic.
hQuery:SET-BUFFERS(hBuffer).
hQuery:QUERY-PREPARE("FOR EACH " + cip-tablename + " WHERE " + cip-condition).
hQuery:QUERY-OPEN().


create temp-table hTT.
hTT:Create-Like(cip-tablename).
hTT:temp-table-prepare("tt" + cip-tablename).

hTTb = htt:default-buffer-handle.
hTTb:buffer-create().
hTTb:buffer-copy(hBuffer).


CREATE QUERY hQuery1.
hQuery1:SET-BUFFERS(hTTbh).
hQuery1:QUERY-PREPARE("for each tt " + cip-tablename).
hQuery1:QUERY-OPEN().

CREATE BROWSE hbrowse-hdl1
ASSIGN
TITLE     = cip-tablename + " Browse"
FRAME     = Frame DetailsFrame:Handle
QUERY     = hQuery1
X         = 48
Y         = 100
WIDTH     = 96
DOWN      = 10
VISIBLE   = YES
SENSITIVE = TRUE
READ-ONLY = yes.
hbrowse-hdl1:ADD-COLUMNS-FROM(hTTbh).

I have creted one dynamic temp-table and dynamic query.Now I want to populate it into browse.Here is my code.My issue is it is showing error like "source element of a buffer-copy statement has no record(5365)".
How to solve this one?
cip-tablename = tableName getting from UI

CREATE BUFFER hBuffer FOR TABLE cip-tablename.


CREATE QUERY hQuery.        /*this query I need for some other logic.
hQuery:SET-BUFFERS(hBuffer).
hQuery:QUERY-PREPARE("FOR EACH " + cip-tablename + " WHERE " + cip-condition).
hQuery:QUERY-OPEN().


create temp-table hTT.
hTT:Create-Like(cip-tablename).
hTT:temp-table-prepare("tt" + cip-tablename).

hTTb = htt:default-buffer-handle.
hTTb:buffer-create().
hTTb:buffer-copy(hBuffer).


CREATE QUERY hQuery1.
hQuery1:SET-BUFFERS(hTTbh).
hQuery1:QUERY-PREPARE("for each tt " + cip-tablename).
hQuery1:QUERY-OPEN().

CREATE BROWSE hbrowse-hdl1
ASSIGN
TITLE     = cip-tablename + " Browse"
FRAME     = Frame DetailsFrame:Handle
QUERY     = hQuery1
X         = 48
Y         = 100
WIDTH     = 96
DOWN      = 10
VISIBLE   = YES
SENSITIVE = TRUE
READ-ONLY = yes.
hbrowse-hdl1:ADD-COLUMNS-FROM(hTTbh).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

相思碎 2025-01-15 21:58:35

您缺少一些将数据从源查询复制到 TT 的代码:

hQuery:Get-FIRST(no-lock).

DO WHILE hbuffer:AVAILABLE:

   hTTb:buffer-create().
   hTTb:buffer-copy(hBuffer).
   hQuery:Get-NEXT(no-lock).

END.

坦率地说,仅显示源表中的浏览会更容易。

You're missing some code to copy data from the source query to the TT:

hQuery:Get-FIRST(no-lock).

DO WHILE hbuffer:AVAILABLE:

   hTTb:buffer-create().
   hTTb:buffer-copy(hBuffer).
   hQuery:Get-NEXT(no-lock).

END.

Frankly, it'd be easier to just show the browse from the source table.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文