Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / September 2006

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
new - 18 Sep 2006 00:31 GMT
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
Knut Stolze - 18 Sep 2006 12:50 GMT
> 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.

Signature

Knut Stolze
DB2 Information Integration Development
IBM Germany

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.