Search Postgresql Archives

Re: KeyError: self._index[x]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sorry, accidentally pressed send.


cur_p = conn_pr(cursor_factory=psycopg2.extras.DictCursor)
cur_t = conn_t.cursor(cursor_factory=psycopg2.extras.DictCursor)


cur_t.execute("""
                SELECT TRANSLATE(snumber, ' ', '')
                FROM sprofile """)

# This will result in KeyError
for row in cur_t:
print row['snumber']

# This works fine
for row in cur_t:
print row[0]

Sorry again.

I would really appreciate any suggestions.

Thanks,
J


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux