By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,236 Members | 1,309 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,236 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.