Generic Mload script for UPSERT


Generic Mload script for UPSERT

Hi All,

Can we write a generic mload script to load different files into different table. MLoad need to be generic which can read multiple files and load the data into  different target tables sequntially. ex: File tableA.txt contain column details of TableA, TableB.txt contain column details of TableB. Generic mload should import these files sequntially to create the table and upsert the data. Can anyone please provide example for the same?



Re: Generic Mload script for UPSERT

You need to use the shell script capabilities (or windows batch program/powershell) to do this.

So it would be become a fram work for your robust development. Below is an high level idea -

1) Read the files in shell with a for loop or while loop

2) create different files each for one definition of mload-

     logon ; begin mload; layout definition; dml definition; apply statement

 For ex:  count the columns in the input files and display the layout of the files in another file.

3) combine all of these files and create the mload scripts and run it.