getting an empty tuple

nephish at nephish at
Sun Jul 31 17:40:26 CEST 2005

Hey there,
i have a simple database query that returns as a tuple the number of
rows that the query selected.
kinda like this

>>> cursor.execute('select value from table where autoinc > 234')
>>> x = cursor.fetchall()
>>> print x

>>> 21L

ok, means 21 rows met the criteria of the query. but if there are none
that match,
like i do a

>>> print x
>>> 0L

how do i encorporate that into an equation ?
i have tried all kinds of stuff

if x == 0L
if x(0) == None
if x == None

anyway, what shoud i do to test if the result is empty?


More information about the Python-list mailing list