[DB-SIG] Database API clarifications

Tod Olson Tod Olson <ta-olson@uchicago.edu>
Mon, 26 Jan 1998 12:00:26 -0600


I'm working on a Sybase interface for Python.  The ones that exist do
not appear to permit sufficient low-level access for my needs, so I'm
implementing a low-level interface as a wrapper around Open Client and
will build a database-API-compliant interface on top of that.

Sybase permits one to issue a command that will generate multiple
result sets.  The database-API does not directly address this
possibility.  How should the fetch*() functions distinguish to the
Python programmer the difference between the end of the current result
set and the end of all data returned by the command?

Under the current database-API, the programmer could loop over any of
the fetch*() functions, have None signal end of all results, and look
for a change in description to signal a new result set.  (Personal
bias: fetchmany() and fetchall() should only return rows from one
result set on any invocation.)  But this is potentially unreliable, as
two result sets might have the same descriptions.

Another question: once any of fetch*() returns None, should they
continue to return None until the next command is sent, or can they
signal an error after returning None?

I'm interested in these fetch*() details because I am implementing
them (so for as possible) directly in my low-level interface.

Anyone else running into these issues?  Anyone else interested in
lower level access to Sybase?

Thanks.

Tod A. Olson                        "How do you know I'm mad?" said Alice.
ta-olson@uchicago.edu               "If you weren't mad, you wouldn't have
The University of Chicago Library    come here," said the Cat.

_______________
DB-SIG  - SIG on Tabular Databases in Python

send messages to: db-sig@python.org
administrivia to: db-sig-request@python.org
_______________