executemany ('SELECT ...') (was: [DB-SIG] DBAPI-2.0 clarification s)

Dittmar, Daniel daniel.dittmar@sap.com
Mon, 19 Mar 2001 17:52:05 +0100

Whether executemany ('SELECT ...', [...]) returns one or multiple result
sets, couldn't that be implementation dependant? Unless the client really
wants to know which result record come from which input parameter record, it
shouldn't really matter.

Why is this a problem?

When the database doesn't support array execution, implementing the notion
of a single result set is at least cumbersome.

When the database does support array execution, then returning multiple
result sets is inefficient (because multiple SELECTs have to be executed +
possibly the overhead of closing the result sets). In addition, it would
require different handling for INSERTs/UPDATEs and SELECTs, which (depending
on the underlying API) might require parsing the SQL.

The client would have to expect multiple result sets.


Daniel Dittmar
SAP DB, SAP Labs Berlin