使用多记录的Oracle表单更新表

使用多记录的Oracle表单更新表,oracle,for-loop,oracle11g,oracleforms,oracle-cursor,Oracle,For Loop,Oracle11g,Oracleforms,Oracle Cursor,我有一个多行块,在oracle窗体中看起来像这样: 我的问题是: Select * from table1; 看起来像这样: +-----+ |value| +-----+ | 3| | 3| | 7| | 1| +-----+ +-----+ |value| +-----+ | 4| | 6| | 14| | 2| +-----+ 列值是表中要更新为列新的列: 因此,当我重新查询时,表中的值应如下所示: +-----+ |value| +

我有一个多行块,在oracle窗体中看起来像这样:

我的问题是:

Select * from table1;
看起来像这样:

+-----+
|value|
+-----+
|    3|
|    3|
|    7|
|    1|
+-----+
+-----+
|value|
+-----+
|    4|
|    6|
|   14|
|    2|
+-----+
是表中要更新为列的列:

因此,当我重新查询时,表中的值应如下所示:

+-----+
|value|
+-----+
|    3|
|    3|
|    7|
|    1|
+-----+
+-----+
|value|
+-----+
|    4|
|    6|
|   14|
|    2|
+-----+
我尝试了post表单提交:

for i in 1 .. :rec_count
loop
    update table1
    set value = :new
    where value = :value;
end loop;
但这只更新了我的最后一条记录

可以使用while循环,通过按钮按下智能触发器,内置第一个\u记录和下一个\u记录,代码如下:

declare
   v_blk varchar2(25) := 'block1';
begin   
   go_block(v_blk);
   first_record;
 while ( :value is not null ) 
 loop
  :value := :value + nvl(:added_value,0);
   next_record;
 end loop;

   commit_form;    

   go_block(v_blk);
   execute_query;
end;