• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Need Transaction Sample Codes.

#1
1. Suppose there are 99 records and we get error or press endkey at 98 record, transaction should skip that 98th record and complete the transaction for 99th record.

2. Suppose there are 99 records and we get error or press endkey at 98 record, transaction back out completely.

Please do provide sample codes for these two scenarios.

Help me out with some best progress concepts documents.
Email: 18somashekar@gmail.com.
 
#3
1. Suppose there are 99 records and we get error or press endkey at 98 record, transaction should skip that 98th record and complete the transaction for 99th record.

2. Suppose there are 99 records and we get error or press endkey at 98 record, transaction back out completely.

Please do provide sample codes for these two scenarios.

Help me out with some best progress concepts documents.
Email: 18somashekar@gmail.com.
1.-
REPEAT TRANSACTION:
<some stuff: read "n" record >
<some stuff: update "n" record >
END.
2.-
DO TRANSACTION:
REPEAT:
<some stuff read "n" record >
<some stuff: update "n" record >
END.
<some stuff: confirm all ok or undo >
END.
 
#4
Why don't you just load those records into a temp-table, do your updates on the temp-table.

If you want to "undo" the whole thing, then do whatever you want (message, errors list whatever) and perform no updates.

If you want to "undo" only the records in error, either delete them from the temp-table or flag them as errors, then just update the records that passed the update criteria.