Hi team,
Need help to accomplish something as below. Lets say I have EMPLOYEE table as
EMP_NO | SALUTATION | EMP_NAME |
---|---|---|
1 | MR | Rohit |
2 | MS | Arundhati |
3 | MS | Lakshmi |
4 | MR | Raj |
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 |
---|---|---|
1 | MR | Rohit |
2 | MS | Arundhati |
3 | MS | Lakshmi |
4 | MR | Raj |
5 | MR | Rohit |
6 | MR | Raj |
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
If many users may trigger the same workflow at the same time, then there is only one reliable solution to this: a reusable Sequence Generator. Performance-wise this is not really nice because you will want to set the number of cached values to 1 (so that the sequence values are indeed consecutive, i.e. without gaps), but that's the best you can do here.
Regards,
Nico