如何在 4gl 中添加和显示从 code_mstr 到 temp-table 的特定记录?

how to add and display specific records from code_mstr to temp-table in progress 4gl?

我想创建一个 temp-table 用于通用代码维护(code_mstr) 这就是我为 temp-table creation

编写的内容
define temp-table tt_gcm no-undo
field tt_fldname like code_fldname
field tt_value like code_value
field tt_cmmt like code_cmmt
field tt_group like code_group   
field tt_domain like global_domain
index tt_idx
      tt_domain
      tt_fldname
      tt_value.

然后我定义了一个相同的表单

form
code_fldname
code_value
code_cmmt
code_group
with frame a side-labels

我还为 code_fldname 和 code_value 提供了提示,因为我希望它有用户输入

prompt-for code_fldname
editing:
/*wrote the mnfnp05.i logic here that enabled the input */
/*similarly for code_value as well */

现在我只想显示我通过输入字段输入的记录,我不想显示 code_mstr 中存在的所有记录,有没有办法显示那些特定的记录?

您真的不应该为 prompt-for 使用数据库字段。从长远来看,这将导致您遇到记录锁定和事务范围界定问题。最好改用变量。像这样:

define variable codeName as character no-undo.

update codeName.

find tt_gcm where tt_gcm.fldName = codeName no-error.

if available tt_gcm then
  display tt_gcm with frame a.