适用于Oracle的最佳python模块,但可移植到其他RDBMS [英] Best python module for Oracle, but portable to other RDBMSes

查看:67
本文介绍了适用于Oracle的最佳python模块,但可移植到其他RDBMS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对数据库模块的内容感到困惑:

http://python.org/topics/database/modules.html


我想做什么使用Python访问Oracle 9.X数据库,以便将一系列表作为文本文件导出到一个聚合表中,

用于导入大型机数据库。问题是,如果我们从

Oracle切换到其他一些RDBMS,我想要写b代码不需要更改(很多)仍然需要导出为

导入到大型机数据库的文本文件。


看起来我可能想要使用符合的东西

DB-API 2.0。在模块列表中,我看到了DCOracle2,但自2001年以来它没有被更新过。这里的任何人都使用这个模块,并且它与Oracle 9.2和Oracle 10g一起工作吗?是否还有其他符合DB-API 2.0的模块?我应该看看
模块?有什么优点和

可以访问Oracle 9.2和Oracle 10g

数据库的缺点?


提前谢谢。

I''m a little confused about what''s out there for database modules at:

http://python.org/topics/database/modules.html

What I''d like to do is use Python to access an Oracle 9.X database for
exporting a series of tables into one aggregated table as a text file,
for import into a mainframe database. The catch is that I''d like to
write code that wouldn''t need to be changed (much) if we switched from
Oracle to some other RDBMS (still need to export out as a text file for
import to the mainframe database.

Looks like I''d probably want to use something that conforms to the
DB-API 2.0. On the module list, I see DCOracle2, but it hasn''t been
updated since 2001. Anyone here use this module, and does it work with
both Oracle 9.2 and Oracle 10g? Are there other DB-API 2.0 compliant
modules I should be looking at? What are the advantages and
disadvantages of the ones that can access Oracle 9.2 and Oracle 10g
databases?

Thanks in advance.

推荐答案

da*****@yahoo.com écrit:
我对于什么感到困惑以下是数据库模块:

http: //python.org/topics/database/modules.html

我想要做的是使用Python访问Oracle 9.X数据库以进行导出将一系列表格作为文本文件合并到一个聚合表中,用于导入到大型机数据库中。问题是,如果我们从Oracle转换到其他RDBMS(仍然需要以文本形式导出),我想编写不需要更改的代码(很多)
导入到大型机数据库的文件。

看起来我可能想要使用符合
DB-API 2.0的东西。
I''m a little confused about what''s out there for database modules at:

http://python.org/topics/database/modules.html

What I''d like to do is use Python to access an Oracle 9.X database for
exporting a series of tables into one aggregated table as a text file,
for import into a mainframe database. The catch is that I''d like to
write code that wouldn''t need to be changed (much) if we switched from
Oracle to some other RDBMS (still need to export out as a text file for
import to the mainframe database.

Looks like I''d probably want to use something that conforms to the
DB-API 2.0.



你想使用cx_Oracle:

http://www.python.net/crew/atuining/...cle/index.html


现在是最好的python Oracle驱动程序。


Olivier


You want to use cx_Oracle :

http://www.python.net/crew/atuining/...cle/index.html

which is nowadays the very best python Oracle driver.

Olivier


关于数据库的可移植性......


虽然尝试为这些

库提供通用接口是高尚的,但最终的结果是数据库总是不同

足够接口只是必须以不同的方式工作。我的经验从一个数据库中获得
对另一个人来说,无论如何你应该重新访问你的整个数据库界面。 (我记得当我们用Perl的DBI方式返回时,从Sybase转到
Oracle。它仍然非常,非常非常b / b
凌乱。)


所以,选择一个好的模块,从内到外学习它,并计划使用一个完全不同的模块

如果你使用不同的数据库,

或许至少有一个稍微不同的界面。

On database portability...

While it is noble to try to have a generic interface to these
libraries, the end result is that the databases are always different
enough that the interface just has to work differently. My experience
in going from one database to another is that you should revisit your
entire database interface anyway. (I remember going from Sybase to
Oracle when we had Perl''s DBI way back when. It was still very, very
messy.)

So, pick a good module, learn it inside and out, and plan on using a
completely different module if you use a different database, with
perhaps at least a slightly different interface.


谢谢Olivier和Jonathan。


你们两个都做或者其他任何人,知道一个好的开源数据

建模/ ER-diagram / CASE工具?我希望能够在一个开源工具中构建

相对简单的模式,并能够根据需要在不同平台上创建

a数据库(例如MySQL,PostgreSQL ,

甲骨文等等。


只是想知道那里有什么。


谢谢。

Thanks Olivier and Jonathan.

Do either of you, or anyone else, know of a good open source data
modeling / ER-diagram / CASE tools? I''d like to be able to build
relatively simple schemas in one open source tool and be able to create
a database on different platforms as needed (e.g. MySQL, PostgreSQL,
Oracle, etc).

Just wondering what''s out there.

Thanks.


这篇关于适用于Oracle的最佳python模块,但可移植到其他RDBMS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆