Frank Millman schrieb:
> 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'.

The *cursors* themselves support the iteration protocol, not the result
of cursor.execute() (which is obviously None). I.e. you do:

conn = pgbd.connect(database='mydb')
cur = conn.cursor()
cur.execute('select * from mytable')
for row in cur:
    print row

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

Reply via email to