Difference between revisions of "Python DBI"
Jump to navigation
Jump to search
PeterHarding (talk | contribs) |
PeterHarding (talk | contribs) |
||
Line 5: | Line 5: | ||
* http://www.oreillynet.com/oracle/os_dir/library.csp | * http://www.oreillynet.com/oracle/os_dir/library.csp | ||
=DBD== | ==DBD== | ||
==Oracle== | ==Oracle== |
Revision as of 17:50, 28 August 2009
Links
DBI
DBD
Oracle
- Oracle Wiki
- cx_Oracle download from Sourceforge
- http://www.oracle.com/technology/pub/articles/prez-python-queries.html
SAP DB
Exmples
#!/usr/bin/env python import dbi dbh = dbi.connect("DBI:mysql:database=mydatabase", "myysername", RaiseError = 1, PrintError = 0, AutoCommit = 1, ) try: dbh["AutoCommit"] = 0 except: print "Can't turn off AutoCommit" sth = dbh.prepare("select * from foo limit 5") sth.execute() while 1: row = sth.fetchrow_tuple() if not row: break print row dbh.disconnect()