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

Need Transaction Sample Codes.

Discussion in 'Development' started by somashekar, Jul 18, 2017.

  1. somashekar

    somashekar New Member

    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.
     
  2.  
  3. Cringer

    Cringer ProgressTalk.com Moderator Staff Member

    What have you tried so far?
     
  4. Marco Mendoza

    Marco Mendoza Member

    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.
     
  5. LarryD

    LarryD Member

    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.
     
    Ashwani Mishra likes this.

Share This Page