到平面文件的 ODBC 连接

发布于 2024-09-15 23:44:36 字数 92 浏览 1 评论 0原文

将数据库变成平面文件的最佳方法是什么?

我有一个 ODBC 驱动程序,需要将数据提取到文件中。

Excel、Access?开放式办公室?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

审判长 2024-09-22 23:44:36

我建议使用 Excel 作为从任何支持 ODBC 或 OLEDB 的数据源导出数据并将其写入平面文件的最快方法。

alt text

Excel 中的工具有助于调整对数据库的查询。

将其导入 Excel 后,您可以选择另存为 .csv、.txt 或按照您喜欢的方式进行转换。

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.

甜尕妞 2024-09-22 23:44:36

如果您想要建立关系并以数据库方式操作数据,Access 提供了一系列导入选项,至少与 Excel 一样多。

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.

甲如呢乙后呢 2024-09-22 23:44:36

作为替代方案,您可以从数据库运行 SQL 命令来创建 csv 文件。这样做的优点是允许您使用复杂的 SELECT 语句。这是一个使用 MySQL 的简单示例:

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

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';
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文