自动将 Sybase .ADT 文件转换为 SQL
我正在处理我获得的一些数据,这些数据是通过使用嵌入式 Advantage 数据库服务器的程序读取的。该程序不是我编写的,并且不具备我需要的所有功能。我想将这些数据转换为不同的格式,以便我可以更自由地使用它,例如 MySQL。
我知道Sybase提供了一些将单个本地数据库转换为SQL的工具,这非常好。这可以正常工作,只是该程序的作者为用户正在使用的每个新文档创建一个包含新数据库的新文件夹。因此可能有数百个单独的数据库文件夹,每个文件夹中都有数百个 .ADT 文件。
我正在寻找一种方法来自动将这些 .ADT 文件及其架构转换为其他任何内容。我过去使用过的几乎所有其他格式都比较幸运,但这个是最麻烦的。我不需要索引、视图或任何其他东西。我只需要将表导出为另一种格式,以便我可以处理一些数据。
因此,我在这里寻找的解决方案只是一种将单个 Advantage Database Server 本地数据库自动转换为 SQL 的方法。所以我有一个代表数据库的 .ADT 文件的文件夹。
我在标签中包含了 Ruby 和 Python,因为使用其中一种脚本语言是理想的选择,但任何解决方案都很棒。
我现在正在尝试使用 ODBC 驱动程序,但我遇到了麻烦,希望有一个更简单的解决方案。
谢谢!
蔡斯·格雷
I am working with some data I obtained that is read with a program using an embedded Advantage Database Server. The program was not written by me and does not have all of the functionality that I need. I would like to convert this data to a different format so that I can work with it more freely, such as MySQL.
I know that Sybase provides some tools for converting a single local database into SQL, which is very nice. This would work fine, except that the authors of this program create a new folder containing a new database for every new document that a users is working with. So there could be 100s of separate database folders each with 100s of .ADT files in them.
I am looking for a way to automate the process of converting these .ADT files and their schema to basically anything else. I've had more luck with almost all the other formats I've had to work with in the past, this one has been most troublesome. I don't need indexes, views, or any of that. I only need to export the tables to another format so that I can process some of the data.
So the solution I'm looking for here is just a way to automate the conversion of a single Advantage Database Server local database to SQL. So I have a folder of .ADT files that represent the database.
I included Ruby and Python in the tags because using one of these scripting languages would be ideal, but any solution would be great.
The route I'm on right now is trying to work with the ODBC drivers, but I'm having trouble and hoped that there was an easier solution.
Thanks!
Chase Gray
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Advantage 有一个 dbi (Perl) 驱动程序,您可以使用它来访问现有 ADT 格式的表。还有 JDBC 和 OLE DB 驱动程序。请访问 http://devzone.advantagedatabase.com 查看所有内容/dz/content.aspx?key=20&Release=13
请注意,该链接指向版本 9.1 驱动程序。您将需要获取等于或早于正在运行的 Advantage 服务器的驱动程序(除非客户端使用 Advantage Local Server,在这种情况下,这并不重要)。
Advantage has a dbi (Perl) driver you could use to access the tables in their existing ADT format. Also has JDBC and OLE DB drivers. See all of them at http://devzone.advantagedatabase.com/dz/content.aspx?key=20&Release=13
Note that link is to the version 9.1 drivers. You will want to grab a driver that is equal to or older than the Advantage server that is running (unless the client is using the Advantage Local Server, in which case it won't matter).
经过一番询问和搜索后,似乎没有我想要的东西。
今天早些时候,我花了一些时间基于 Ruby DBF gem 整理一些东西。我还没有完成,但它按照我想要的方式工作。我必须完成测试并添加 SQL 的导出等。但希望其他人能找到这个问题,并且可以从 .ADT 文件中检索信息,而无需安装任何东西。
这是该项目的链接。可能整个晚上都会进行。现在它还很小,但随着时间的推移,我可能会添加它。
http://github.com/chasemgray/Ruby-ADT
http://chase.ratchetsoftware .com/2010/02/reading-advantage-database-server-files-adt-in-ruby/
现在获取数据应该像这样简单。
谢谢你的帮助,
蔡斯·格雷
After some asking and searching it seems that there isn't something like what I was looking for.
I spent a little while earlier today putting something together based on the Ruby DBF gem. I'm not finished, but it works like I want it to. I'll have to finish up the tests and add the exporting of SQL, etc. but hopefully somebody else finds this question and can retrieve information from a .ADT file without having to install anything.
Here is the link to the project. It'll be in progress for the rest of the night probably. It's pretty minimal right now, but over time I'll probably add to it.
http://github.com/chasemgray/Ruby-ADT
http://chase.ratchetsoftware.com/2010/02/reading-advantage-database-server-files-adt-in-ruby/
Now getting data out should be as simple as this.
Thanks for your help,
Chase Gray