In <[EMAIL PROTECTED]>, Gabriel
Genellina wrote:
> En Thu, 12 Apr 2007 08:43:49 -0300, Marc 'BlackJack' Rintsch
> <[EMAIL PROTECTED]> escribió:
>
>> In <[EMAIL PROTECTED]>, Jorgen Bodde
>> wrote:
>>
>>>>>> r = c.execute('select * from song where id = 1')
>>>>>> for s in r:
>>> ... print s
>>> ...
>>> (1, u'Spikedrivers Blues', u'Mississippi John Hurt')
>
>> This should not work because `r` should not be a `Cursor` object. The
>> `execute()`-Method returns an integer with the number of "affected rows".
>
> Actually DBAPI 2.0 says the return value is undefined.
I just remembered the number of affected rows, but that's just for data
manipulation statements like ``UPDATE`` or ``INSERT``. For ``SELECT`` the
method should return `None`. My bad.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list