Dynamically create as many files as values in a column
Posted: Sun Apr 08, 2012 2:58 am
Hi,
I came across this interesting requirement. Pardon me if this has already been discussed but I couldn't find it anywhere.
I have a source table with columns:
Name, Age, Location
The Location column can contain any value and is not fixed. For e.g. It may contain New York. it may also contain US. So it can be a city, state, country or even a district.
The requirement is simply to load records belonging to different locations to different files. So if I have 20 locations, the job would have to determine the number of values in Location at runtime and create as many files.
I have devised a logic to implement this using a UNIX script and a looped sequencer. But I was wondering if there's an easier way to implement this.
Help Appreciated
I came across this interesting requirement. Pardon me if this has already been discussed but I couldn't find it anywhere.
I have a source table with columns:
Name, Age, Location
The Location column can contain any value and is not fixed. For e.g. It may contain New York. it may also contain US. So it can be a city, state, country or even a district.
The requirement is simply to load records belonging to different locations to different files. So if I have 20 locations, the job would have to determine the number of values in Location at runtime and create as many files.
I have devised a logic to implement this using a UNIX script and a looped sequencer. But I was wondering if there's an easier way to implement this.
Help Appreciated