Home » Developer & Programmer » Forms » how to avoid records inserted twice!!!!!pls help me
how to avoid records inserted twice!!!!!pls help me [message #79404] Thu, 06 June 2002 21:39 Go to next message
mani
Messages: 105
Registered: September 1999
Senior Member
hai when using data base block...while using the following commands....am getting each record inserted twice in the database...can any one help me....????
thanks...
mani

go_block('TCN_SY');
FIRST_RECORD;
LOOP
INSERT INTO TCN_SY VALUES(........)
IF SYSTEM.LAST_RECORD THEN
EXIT;
ELSE
NEXT_RECORD;
END IF
END LOOP

COMMIT;
Re: how to avoid records inserted twice!!!!!pls help me [message #79408 is a reply to message #79404] Fri, 07 June 2002 05:45 Go to previous message
Sreejith
Messages: 2
Registered: June 2002
Junior Member
This is happening because you are using the insert statement in your code, which is inserting the records once, and again when you issue the commit, d2k is syncronising the data on the forms to that in the table.

There can be solutions:

1. Avoid using the insert stmt. Just the commit will save the info.

2. If u use insert stmt,
use, clear_form(no_commit);
commit;
Previous Topic: How to save data on form without inserting in database
Next Topic: Item at run time
Goto Forum:
  


Current Time: Thu May 23 03:42:48 CDT 2024