E
eight02645999
hi
i use odbc to update a table in a database but i always get return
value of -1
even though i tried to return an integer. the table is updated though
....
sql = """
update table
set column = 0
where col = "%s"
select @@rowcount
""" % (var1)
.....
try:
s = odbc.odbc(connectstring)
cur = s.cursor()
res = cur.execute(sql)
s.commit()
s.close()
cur.close()
s = None
cur = None
print res
return res
except:
print 'error while processing ', sys.exc_type,sys.exc_value
how to properly get a positive return ?
thanks
i use odbc to update a table in a database but i always get return
value of -1
even though i tried to return an integer. the table is updated though
....
sql = """
update table
set column = 0
where col = "%s"
select @@rowcount
""" % (var1)
.....
try:
s = odbc.odbc(connectstring)
cur = s.cursor()
res = cur.execute(sql)
s.commit()
s.close()
cur.close()
s = None
cur = None
print res
return res
except:
print 'error while processing ', sys.exc_type,sys.exc_value
how to properly get a positive return ?
thanks