[DB-SIG] Database API clarifications
Bill Tutt
billtut@microsoft.com
Mon, 26 Jan 1998 11:53:30 -0800
Generally the way to do this is just to have a seperate getNextResult() API
call that you call when your first result set
fetch*() calls return None.
Bill
More computing sins are committed in the name of efficiency
(without necessarily achieving it) than for any other single reason
---including blind stupidity.
> Python: the power of simplicity
> Perl: the power of obscurity
>
>
>
> -----Original Message-----
> From: Tod Olson [SMTP:tao@stone.lib.uchicago.edu]
> Sent: Monday, January 26, 1998 10:00 AM
> To: db-sig@python.org
> Subject: [DB-SIG] Database API clarifications
>
> 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
> _______________
_______________
DB-SIG - SIG on Tabular Databases in Python
send messages to: db-sig@python.org
administrivia to: db-sig-request@python.org
_______________