title: Python - Insert list of tuples into one column in SQLite
body: <p>I've researched similar links, but still can't figure this out. Most of the other links are trying to insert into multiple rows or columns, but I need this list of tuples in one column.</p>
  
  <pre><code>word_in_python = cat
  listOfTuples = [('word1', 12), ('word2', 14), ('word3', 4), ('word5', 23)]
  </code></pre>
  
  <p>Here is my code:</p>
  
  <pre><code>conn = sqlite3.connect('mydb.db')
  c = conn.cursor()
  c.execute("INSERT OR IGNORE INTO saved_words (word, data) VALUES (?, ?)", (word_in_python, [listOfTuples]))
  conn.commit()
  conn.close()
  </code></pre>
  
  <p>I need the INSERT OR IGNORE because the word column is a unique column so duplicate words should not be entered into the db. </p>
  
  <p>I've tried changing to:</p>
  
  <pre><code>c.execute("INSERT OR IGNORE INTO saved_words (word, data) VALUES (?, ?)", (word_in_python, (listOfTuples, )))
  
  c.executemany("INSERT OR IGNORE INTO saved_words (word, data) VALUES (?, ?)", (word_in_python, [listOfTuples]))
  
  for each in listOfTuples:
    c.executemany("INSERT OR IGNORE INTO saved_words (word, data) VALUES (?, ?)", (word_in_python, (each[0], each[1]) ))
  </code></pre>
  
  <p>None of these work. </p>
  
  <p>The error I am typically getting is:</p>
  
  <pre><code>Incorrect number of bindings supplied. The current statement uses 2, and there are 5 supplied.
  </code></pre>
  
  <p>I'm also confused by this error. I understand that (?, ?) in my execute line means I am trying to input 2 bindings. My list of tuples has 10 tuples in it, so I am not sure where the 5 supplied bindings are coming from.</p>
  
  <p>Also, my saved_words table had the data column as type BLOB. I thought this would be best for inserting a list.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>What I want is word_in_python (cat) in one column and in the next column listOfTuples, this is all in one row.</p>