python - Why does adding my Sql UPDATE break my loop? -
i have following code which, without escaped sql statement, working fine - iterates on full set of returns previous select query printing id, detected language (from bingtranslate) , text.
for row in c: lang=bingtranslate(row[0]) tweetid = row[1] print tweetid, lang, row[0] #c.execute('update tweet set iso_language_code=? id=?',(lang, tweetid))
when unescape update call, loops once, , stops.
what gives? no error reported. i'm sure it's simple can't crack it...
i don't know python, try explain in c#.
you're executing command using same object of datareader (c
in python), have reset , strange behaviour.
in opinion don't need copy rows in object, create new command object (empty) , use execute query taking params c
.
correct me if i'm wrong, please.
Comments
Post a Comment