What does cur.execute('...') return?
Paul Hide
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