[Zope] Q: Accessing ZSQL methods from Python

a.wacknitz@francotyp.com a.wacknitz@francotyp.com
Fri, 9 Jun 2000 10:42:00 +0200


> -----Original Message-----
> From: Dieter Maurer [mailto:dieter@handshake.de]
> Sent: Thursday, June 08, 2000 10:21 PM
> To: a.wacknitz@francotyp.com
> Cc: zope@zope.org
> Subject: Re: [Zope] Q: Accessing ZSQL methods from Python
> 
> 
> 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.
Yes, that works fine. But I need to know of NULL values.

> 
> 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.
That was what I thought but at least ZODBC won't do this.
What I have found out is, that repr(SQL NULL) == 'Missing.Value'.

> 
> 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.
ZODBC won't do this either.

> 
> 
> Dieter
> 

Andreas
**********************************************************************
This email message has been swept by MIMEsweeper for the presence of
computer viruses.

Francotyp-Postalia AG & Co.