This discussion is archived
2 Replies Latest reply: Nov 12, 2012 11:56 PM by yasser_egypt RSS

forms 6i update row by row

yasser_egypt Newbie
Currently Being Moderated
dear sirs,
i have form with the folllowing items
item1, item2,item_result
100 20 80
80 10 70
70 10 60

you will find that
1- item_result = item1 - item2
2- the value of item_result will go to item1 that is mean item1 is the second row = item_result

i hope when i make update in item2, item1 and item_result change depend on this update for example
if i make this update
item1, item2. item_result
100 25 75
75 10 65
65 5 60

please tell me how to do code this

thanks in advance
  • 1. Re: forms 6i update row by row
    Andreas Weiden Guru
    Currently Being Moderated
    Don't duplicate posts
  • 2. Re: forms 6i update row by row
    yasser_egypt Newbie
    Currently Being Moderated
    i try to change the style of asking and tell the problem maybe anybody help me and answer, but anyhow i solved myself and here is the code for people.

    i made button to calculate and this the the code for event when_button_pressed

    declare
         cursor c is
         select num1,NUM2,result
         from a;
         counter number(2) := 0;
         v number(5);
         v_net number(5);
    begin
         for i in c loop
              v_net := 0;
         counter := counter +1;
         exit when c%notfound;
                   v_net := :num1 - :num2;
              go_block('a');
              next_record;
                   if :id is not null then
                        :num1 := v_net;
                   end if;
              end loop;
    end;

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points