pymssql

Lawrence D’Oliveiro lawrencedo99 at gmail.com
Thu Sep 8 22:38:12 EDT 2016


On Friday, September 9, 2016 at 12:48:50 PM UTC+12, sum abiut wrote:
>     cus.execute("SELECT * FROM glbud ")

Never use “select *”, except for testing.

>     for row in cus:
>            print(row)
> this works perfect, but when i try to iterate through and only print out
> specific fields i got the error NameError: name 'budget_code' is not defined

Possibly because you are getting back a tuple? Are you expecting some other object type?



More information about the Python-list mailing list