ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Extract DB2 data to text files (https://www.excelbanter.com/excel-programming/396804-extract-db2-data-text-files.html)

Mahesh

Extract DB2 data to text files
 
Hi,
I have a list of queries in an excel workbook which need to be run on DB2
database and I am looking for a macro which can run these queries and save
the data in txt files. The output of these queries is more than 100K records
so I want to save it in txt files.

Please let me know if this is possible. If so, can you please let me know
the connection string and syntax to export the data to txt files.

Please let me know on this.

Thanks,
Mahesh

joel

Extract DB2 data to text files
 
The best way is to record a macro while doing the query manually. go to tool
Menu - Macro - Record new macro.

The go to Data Menu- Import Externa data - New Database Query.

Run the Query. Then stop the macro.

You can also save the reults in a textt file as part of the recorded macro.

I would recommend savving the files as a CSV file instead of text. The CSV
file is text but seperates the columns with commars which is easier to read
be other programs.

the go to

"Mahesh" wrote:

Hi,
I have a list of queries in an excel workbook which need to be run on DB2
database and I am looking for a macro which can run these queries and save
the data in txt files. The output of these queries is more than 100K records
so I want to save it in txt files.

Please let me know if this is possible. If so, can you please let me know
the connection string and syntax to export the data to txt files.

Please let me know on this.

Thanks,
Mahesh



All times are GMT +1. The time now is 05:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com