[DB-SIG] RE: null value doubt?

Hrvoje Niksic hniksic@iskon.hr
30 Jun 2000 09:22:51 +0200

Mohideen Abdul Kader <sa_mak@yahoo.com> writes:

> from the above code return null value , how can i check x[]0
> contains null vlaue pls give the example if python contains any
> isnull or isempty or null keywords

In DB-compliant modules, SQL NULL values should map to Python None.
You can check for it using `x is None' or `x == None'.  For instance:

if x[0] is None:
  print "Empty"
  print x[0]