命令查找临时表中的条目数

时间:2012-08-10 15:24:26

标签: progress-4gl openedge

查找临时表中条目/行数的命令是什么?版本10.2b

2 个答案:

答案 0 :(得分:4)

/* create a temp-table so that we can test this technique
 */

define temp-table ttTest
  field id as int
.

create ttTest.
id = 1.
create ttTest.
id = 2.

/* how many records?
 */

define query q for ttTest cache 0.
open query q preselect each ttTest.
display num-results( "q" ).

答案 1 :(得分:1)

或者你可以使用经典FOR FOR EACH:

DEFINE VARIABLE iCount AS INT NO-UNDO.

FOR EACH ttTest:
  iCount = iCount + 1.
END.

DISPLAY iCount.