Unanswered: Processing A LARGE Table Sequentially using DB2 on the IBM I
I am trying to pull information for specific transactions from our FedEx server transmission file on the IBM I. The record length is 32,766 characters and there can be several hundreds of thousands of records on the file. I need to pull specific shipping transactions and the records must be read in the right sequence or the data will be interpreted improperly. I am using the following to ensure the records are processed sequentially:
exec sql declare web cursor for select
substr(webapit,1,1000), rrn(webapit) from webapit
where substr(webapit,1,100) like :webshipmentid
order by rrn(webapit);
As the file grows, the response time gets worse. There are several users that will be accessing this program and all of them will be trying to re-arrange this huge file by rrn. I need another option. Can anyone provide a faster solution? Note: I am running the sql embedded in an RPG program.