Daniel Kivatinos
Daniel Kivatinos

Reputation: 25006

ODBC Connection to Flat file

What is the best way to take a database and make it a flat file?

I am have an ODBC driver and need to pull the data out into a file file.

Excel, Access? OpenOffice?

Upvotes: 0

Views: 1693

Answers (3)

Edward Leno
Edward Leno

Reputation: 6327

As an alternative, you could run a SQL command from the database to create the csv file. This has the advantage of allowing you to use complex SELECT statements. Here is a simple example using MySQL:

select emp_id, emp_name from emps 
into outfile 'c:/test.txt';

Upvotes: 1

Fionnuala
Fionnuala

Reputation: 91316

If you want to set up relationships and to manipulate the data database-style, Access offers a range of import options, at least as many as Excel.

Upvotes: 1

p.campbell
p.campbell

Reputation: 100557

I'd suggest Excel as the fastest way to export data from any datasource that supports ODBC or OLEDB and write it out to a flat file.

alt text

The tools in Excel are helpful in shaping the query to the database.

Once you get it into Excel, you can then choose to Save As to .csv, .txt or transform it however you like.

Upvotes: 2

Related Questions