Home » Developer & Programmer » Forms » Update by cursor
Update by cursor [message #80494] Tue, 01 October 2002 22:22 Go to next message
Shofi
Messages: 3
Registered: October 2002
Junior Member
Hi Friends,
I have written a cursor for updating a table from some tables by pressing a Push Button/when button press. But it is taking always the first records for all rows. I have given the code below. Could anybody help me?

declare
cursor upe
is
select employee_payment.id im,allowance.id ia,allowance.shoe sh,allowance.fasting fa,
allowance.bonus bu,allowance.eidgratia ei, overtimeal.id io, overtimeal.total ot,
nightal.id ig,nightal.total nt from employee_payment,overtimeal,nightal,
allowance where :employee_payment.id=allowance.id and :employee_payment.id=overtimeal.id
and :employee_payment.id=nightal.id;

al upe%rowtype;

begin
open upe;
loop
fetch upe into al;
exit when upe%notfound;
update employee_payment
set totalallowance =al.sh+al.fa+al.bu+al.ei+al.ot+al.nt
where al.im=al.ia and al.im=al.io and al.im=al.ig;
end loop;
close upe;

end;
Re: Update by cursor [message #80546 is a reply to message #80494] Thu, 10 October 2002 03:01 Go to previous message
KK
Messages: 24
Registered: March 2002
Junior Member
Can u rephrase the question plz
Previous Topic: unlocking rows
Next Topic: Using LOV for multiple items
Goto Forum:
  


Current Time: Fri Apr 26 11:16:45 CDT 2024