I am performing an update on a file that contains over 20 billion records through sql for as400.
UPDATE "LIBRARY"/AR#RMTPRL9
SET SENTFLAG = ' ', DATESENT = '0001-01-01', TIMESENT = '00:00:00', XMITT# = 0, LOCATION = 'PACI175A', ARBATCH# = ' ‘
WHERE LOCATION = 'PACI173A' AND ARBATCH# = 'PAR1981181'
How can I run this update for different values of arbatch# in a single query to save time?
eg: I would like to use the same update statement for ARBATCH# values PAR19811284, PAR18736765 etc.
REEDITS:
I have the following data:(Move these values to location EFG)
LOCATION ARBATCH#
ABC 1234
ABC 5468
ABC 8765
XYZ 6759
XYZ 5432
Here i would like to achieve a query which would perform update for records as follows:
UPDATE "LIBRARY"/AR#RMTPRL9
SET SENTFLAG = ' ', DATESENT = '0001-01-01', TIMESENT = '00:00:00', XMITT# = 0, LOCATION = 'EFG', ARBATCH# = ' ‘
WHERE LOCATION = 'ABC' AND ARBATCH# = '1234'
Now how could i successfully use “in” for such an update
You can ‘cheat’ pretty trivially:
(Statement run on my local iSeries DB2 instance)
Incidently,
DATESENTandTIMESENTshould be combined into a single timestamp, and probably be nullable, too. I’d personally prefer something likesentAtfor the name, not something including the type of the column.