duplicacy in records occuring [message #418932] |
Wed, 19 August 2009 04:08 |
simcky
Messages: 38 Registered: July 2009
|
Member |
|
|
hi i m writting this when-button-pressed trigger
begin
delete from prmamed
where empno=:prmamed.empno
and earningdeduction=:prmamed.earningdeduction;
go_block('prmamed2');
first_record;
LOOP
INSERT INTO PRMAMED(EMPNO,EARNINGDEDUCTION,PAYPERIOD,REFNO,AMT,REFDATE)
VALUES (:prmaMED2.EMPNO,:prmaMED2.EARNINGDEDUCTION,:PRMAMED2.PAYPERIOD,:PRMAMED2.REFNO,:PRMAMED2.AMT,:PRMAMED2.REFDATE);
EXIT WHEN :SYSTEM.LAST_RECORD = 'TRUE' ;
END LOOP;
NEXT_RECORD;
clear_form(do_commit);
END;
it's work is to delete the previous records and insert the new one it's working but the problem is that duplicacy of records is occuring at backend pls help me out to remove the duplicacy
[Updated on: Wed, 19 August 2009 04:14] Report message to a moderator
|
|
|
|
Re: duplicacy in records occuring [message #418939 is a reply to message #418932] |
Wed, 19 August 2009 04:50 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
1) Can you please use code tags - see the orafaq forum guide if you don't know how.
2) That loop is either going to insert 1 row or an infinite number rows - the next_record is in the wrong place.
@kame - I doubt an extra commit is going to make any difference.
|
|
|
|