i have to transmit data from a table to an external system . data fetching should happen in parallel by multiple process. in order to avoid multiple process fetching same records i have used 'select for update skip locked'. each process has to fetch 25 records and do the processing .table contains a column FREE_TEXT_1 which will have initial value as 'N'. each process needs to fetch 25 records and do the processing. while processing column value will be changed to 'P' and once data is transmitted, value of column will be 'T'.
My select query looks like this
select * from table where free_Text_1 ='N' for update skip locked
[each process will fetch 25 records and then change the status of free_Text_1 = 'P' and then do a commit so that lock on the records will be removed and next process can fetch next set of 25 records]
problem here is each process is putting a lock on entire set of records with free_Text_1 ='N' so that next process has to wait for the first process to finish and then proceed thereby not achieving parallel processing . is there any way i can select 25 records each and ensure that no process will not fetch same set of records . Please help