[Zope-DB] Re: ZSAPDB Connector Weirdness

Daniel Dittmar daniel.dittmar@sap.com
Wed, 30 Jul 2003 01:12:25 +0200


Samir Mishra wrote:
> I'm using the ZSAPDB connector and I'm getting some very strange behaviour.
> 
> On a table ABC, with columns A, B & C, if I run the query 
> select * from ABC
> I get back all of the rows.
> 
> Now, if I run the query -
> select * from ABC order by A
> my result set is empty! 
> 
> The same query runs as expected when I run it in the SAP-DB SQL Studio.

The first test would be to run the query directly through the python module:

import sapdb.sql
session = sapdb.sql.connect (USERNAME, PASSWORD, dbname, host)
for row in session.sql ('select * from ABC order by A'):
     print row

If this gives no results as well, the only difference could be the 
submode ODBC, try using sapdb.sql.connect (..., 'component=ODBC').

If there are no results either, I need to have a look at the vtrace 
(http://sapdb.2scale.net/moin.cgi/VTrace) both for the Python case and 
the query from SQL Studio.

If the query above produces some results, then the rows get lost either 
in the dbapi module or in the ZSapdbDA.

To test for errors in dbapi module: add some print statements to the 
method __fetchmany in dbapi.py. Start Zope from the console and not as a 
service to actually see the traces.

Please tell me about the results so far. If there have been results 
visible, the problem seems tto be in the database adapter and I'll have 
to look there where best to put traces.

Daniel Dittmar

-- 
Daniel Dittmar
SAP DB, SAP Labs Berlin
daniel.dittmar@sap.com
http://www.sapdb.org