[Zope] Q: Accessing ZSQL methods from Python

Dieter Maurer dieter@handshake.de
Thu, 8 Jun 2000 22:20:38 +0200 (CEST)


a.wacknitz@francotyp.com writes:
 > my question is what type or value is returned by a ZSQL method that is
 > invoked from Python?
ZSQL methods return "Shared.DC.ZRDB.Results.Results" instances.
Such an instance essentially behaves like a sequence of
objects each describing one result row.
These objects have been set up such that a column value
can be accessed as attribute with the column name.
Thus, "results[i].column" gives the value of "column" of
the i.th row.

How to determine, how "Null" values are recognized,
is less a Zope than a database adapter question.
I would expect, that most (if not all) database
adapters will map SQL Null to None.

However, even some well established SQL databases do not
treat Null standards-conform but represent it as
the empty string. Then, the database adapter has
no chance to map this to None but must use '', too.


Dieter