[PYTHON DB-SIG] SQL interface
Thomas Breuel
tmb@best.com
Fri, 11 Oct 1996 17:33:10 -0700
The database interface encompasses many databases, not just SQL.
Thanks for the response. Unfortunately, it seems to me that Python's
database interface is significantly more limited than ODBC, JDBC, or
Perl DBI (see my previous message) and/or not specified in enough
detail to actually write code that would be portable from one database
to another. It seems to me that most database interfaces, whether they
use SQL as their query language or not, should make a distinction
between a prepared statement and an iterator over the set resulting
from actually binding query parameters and executing the query.
Of course, also, it isn't clear to me whether the generality of
supporting non-SQL databases is really worth the limitations that
that will impose on the interfaces; to put it differently,
a special interface for Python to SQL databases analogous to ODBC
or DBI would seem like a good idea to me.
Is there still any kind of active discussion of those issues going on
or are things frozen?
Source code for ODBC is publically available in the PythonWin
distribution. Somebody (I don't have the reference) ported the
Win32 ODBC code to Unix ODBC code (mainly some simple tweaking of
includes and removing some spurious C++ usage). You could create a
DB2 implementation based on one of those, if DB2 is quite close to
ODBC (or simply contact DB2 via the ODBC implementation and an ODBC
driver for DB2).
Thanks, that's nice to know. DB2's CLI interface is a superset of
ODBC, so that should make things really easy.
Thomas.
=================
DB-SIG - SIG on Tabular Databases in Python
send messages to: db-sig@python.org
administrivia to: db-sig-request@python.org
=================