All Forums Database
sinara 7 posts Joined 10/15
13 Mar 2016
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?

sgarlapa 88 posts Joined 03/13
13 Mar 2016

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.

You must sign in to leave a comment.