How to get output of queries to files at runtime

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nirmalya2006
    New Member
    • Oct 2011
    • 1

    #1

    How to get output of queries to files at runtime

    Hi All
    I had been going through quite a lot of the articles but didn't come across the situation I am facing now.

    I want to run some queries that I have in an input file.
    I want the out of all those queries in separate output files.

    Example
    I have query1, query2, query3 loaded in a file named as input.txt. Now I want the output of query1 to come in output1.txt, output of query2 to come to output2.txt and so on.

    I tried to use db2 -tvf input.txt -z <output filename>

    But the output of all the queries is coming in 1 single file. I want to change the output file at runtime with the queries.

    Can anybody provide me any idea on this.

    Thanks a lot in advance
Working...