Paul Hide wrote:
> 
> What does cur.execute('...') return?
> 

I entered this at the interpreter prompt -

>>> x = cur.execute('select * from mytable')
>>> type(x)
<type 'NoneType'>

Is this what you wanted to know?

Thanks

Frank


> 2009/1/19 Frank Millman <[email protected]>
> 
> 
>       Hi all
>       
>       According to the Changelog, cursors now support the 
> iteration protocol.
>       
>       I tried the following -
>       
>       import pgdb
>       conn = pgbd.connect(database='mydb')
>       cur = conn.cursor()
>       for row in cur.execute('select * from mytable'):
>        print row
>       
>       I get 'TypeError: NoneType object is not iterable'.
>       
>       If I do it the old way -
>       
>       cur = conn.cursor()
>       cur.execute('select * from mytable')
>       for row in cur.fetchall():
>        print row
>       
>       it works correctly.
>       
>       What am I doing wrong?
>       
>       Thanks
>       
>       Frank Millman
>       
>       _______________________________________________
>       PyGreSQL mailing list
>       [email protected]
>       http://mailman.vex.net/mailman/listinfo/pygresql
>       
> 
> 
> 

_______________________________________________
PyGreSQL mailing list
[email protected]
http://mailman.vex.net/mailman/listinfo/pygresql

Reply via email to