I need to update Customer table in chunk of 50K, The number of records in customer table is 2 million.
I am using DB2 command prompt to execute my sql from a file using bat file.
There are two file which I have created.
1. customerupdate.bat
DB2 CONNECT TO DBTEST USER DB2ADMIN USING XXXXXX
set start=%1
set end=%2
db2 -l D:\vinu\CUSTOMERADDRESS.log -mstf D:\vinu\CUSTOMERADDRESS.sql
2. customer.sql
update customer set firstname='XXXX' where customercid between 1 and 50000
Here I need to pass 1 and 50000 value from command prompt.
update customer set firstname='XXXX' where customercid between 1 and 50000
I am executing above sql using below command successfully, However I need pass the parameter to sql file.
C:\Program Files\IBM\SQLLIB\BIN>customerupdate.bat 1 50000
Please note: I cannot use the query directly like
db2 -l D:\vinu\CUSTOMERADDRESS.log -mst " update customer set firstname='XXXX' where customercid between %1 and %2" The query should be supplied from a sql file only.