469,912 Members | 1,828 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,912 developers. It's quick & easy.

DB2 SQL Query export to flat files as a function of data on each record

new
I have data for each week in a single table. I need to export this data to
a separate flat file for each week.

Any ideas?
DB2 SQL Query export to flat files as a function of data on each record
Sep 17 '06 #1
1 5028
new wrote:
I have data for each week in a single table. I need to export this data
to a separate flat file for each week.

Any ideas?
DB2 SQL Query export to flat files as a function of data on each record
To the best of my knowledge, DB2's EXPORT command does not support what you
want to do. But you could probably use the ADMIN_CMD procedure like this:

(1) Generate the filename for a given week.
(2) Generate the SELECT statement for the data of this week.
(3) Call ADMIN_CMD to export the data selected by (2) to the file of (1).
(4) Pack the whole stuff into another procedure so that you can automate it.

Another alternative would be to roll your own UDF
(http://tinyurl.com/lu4wg). Then you can do the stuff in a single SELECT
statement.

--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Sep 18 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by BT3 | last post: by
10 posts views Thread by Dennis Farr | last post: by
3 posts views Thread by Porkapalooza | last post: by
5 posts views Thread by Sam | last post: by
15 posts views Thread by lxyone | last post: by
3 posts views Thread by =?Utf-8?B?YzY3NjIyOA==?= | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.