title: Update rows in sql with new values
body: <p>i am working on python. i want to update every row of sql with new value.
  my code is:</p>
  
  <pre><code>val = cursor.execute("select id from tweeter1")
      words= processedRow.split()
      fdist2=len(words)
      for id1 in val:
          cursor.execute("""UPDATE TWEETER1 SET t1=%s where id = %s""",(fdist2,id1))
          db.commit()
  </code></pre>
  
  <p>when i execute this code i got an error saying:</p>
  
  <blockquote>
    <p>for id1 in val:
    TypeError: 'long' object is not iterable</p>
  </blockquote>
  
  <p>any help will be highly appreciated. Thank you</p>