All Forums Tools
uco 15 posts Joined 12/13
09 Mar 2014
BTEQ exporting multiple files based on column value in a table

Can anyone please give me some thoughts  on this
I have a scenario where I need to create multiple extract files based on a column values using bteq script and in unx environment.

 table abc 


C_Name   ID

xxxxx        1

yyyy          1

aaaaa       2

bbbbb       2

ccccc         1

Now i need to create  files based up on ID and the outfile  name should Name_ID.txt (Eg: Name_1.txt).

And Name_1.txt should have 1's Data only...

There are many more columns in the extract but for example i am using 2 columns




SuSeSi 61 posts Joined 10/08
19 Mar 2014

You can try with two bteq scripts. Run 1st betq script and get the unique IDs exported to a file. With a shell script, read the exported file and pass value and call 2nd bteq script which export the data with a WHERE clause as the passed value.


You must sign in to leave a comment.