1 Reply Latest reply on Oct 18, 2020 6:03 AM by Nico Heinze

    Process one row at time with auto increment in pk column based on max value in target

    Rohit Borse Active Member

      Hi team,

       

      Need help to accomplish something as below. Lets say I have EMPLOYEE table as

       

      EMP_NO SALUTATION EMP_NAME
      1MRRohit
      2MSArundhati
      3MSLakshmi
      4MRRaj

       

      Now, I want to filter records (say by SALUTATION = 'MR') and insert filtered records into same table by updating EMP_NO of these records to MAX(EMP_NO)+1. Expected output should be as follows

       

      EMP_NO SALUTATION EMP_NAME
      1MRRohit
      2MSArundhati
      3MSLakshmi
      4MRRaj
      5MRRohit
      6MRRaj

       

      Note that workflow will be triggered in parallel by many users. So before record is committed in target table, it should fetch max value of EMP_NO column and then increment it by 1.

       

       

      Best Regards

      Rohit Borse