ODBC package (was [Python-au] RE: python-au Digest, Vol 16, Issue 2)

Malcolm Tredinnick malcolm at commsecure.com.au
Sun Oct 31 21:50:56 CET 2004


On Fri, 2004-10-29 at 15:42 +0100, James Bourke wrote:
> Hi there,
> 
> I'm using a scripts with the generic (i.e unsupported) ODBC package (based 
> on API v2.0). Has anyone come across problems when reading NULL values when 
> querying Sybase ? (v12.5). The results tuple seems to populate NULL column 
> values with None instead.

What do you expect to happen?

This is normal behaviour for a database wrapper in Python. There is no
NULL type in Python (well there is; it's called None). SQL NULLs cannot
be converted to empty strings because then there would be no way to tell
the difference between empty strings in the database and NULLs (and they
obviously are different).

Apologies in advance if I have misunderstood your problem. Maybe you can
give an example of what you are seeing versus what you expect.

Cheers,
Malcolm




More information about the python-au mailing list