insert into TEMP_MATURED_FD_DTL
SELECT * FROM MATURED_FD_DTL WHERE ACCT_FD_NO = :acct_fd_NO;
EXIT WHEN :SYSTEM.LAST_RECORD='TRUE';
MESSAGE('RECORD HAS BEEN UPDATED AS PAID');
1 person found this helpful
You did the same conceptional errors as in your previous post. Instead of looping over all records, you should have used the POST-INSERT or POST-UPDATE-triggers.
Also, you have two commits in your code which can cause corrupt data. What happens when the first commit works and something goes wrong during the second inserts?
I used Commit_form is to save at form_level.
I also have to do a commit , independently for DB.
So i have used two commits.
How do you want me to do , if not with two commits??
In this situation your commit_form and the commit, both do exactly the same thing.
Also in this situation both commands commit for the database (there isn't a separate form_level).
All of the items identified by Andreas are relevant and expose your lack of understanding of how forms works. Reading a book on Forms basics would seem to be a good idea.
As already said, put the logic to insert the records in your POST-INSERT or POST-UPDATE-trigger (of course without the loop). In your KEY-COMMIT you will only have a COMMIT_FORM whcih commits both the forms-data and the outstading database-transactions.