title: Don't understand this "Not enough parameters for the SQL statement" error
body: <pre><code># Import libraries
  import os, re, subprocess, pyautogui, time, datetime, io
  import mysql.connector
  import csv
  
  
  connection = mysql.connector.connect(
      user="xxxxx", password="xxxxxx", host="192.168.0.6", database="xxx"
  )
  
  cur = connection.cursor(buffered=True)
  
  table = "inmuebles"
  
  query = "SELECT * FROM %s;" % table
  
  cur.execute(query)
  
  with io.open("test.csv", "w", encoding="utf-8") as f:
      writer = csv.writer(f, delimiter=";")
      for row in cur.fetchall():
          writer.writerow(row)
  
  connection.commit()
  cur.close()
  connection.close()
  
  
  ##############
  ### IMPORT ###
  ##############
  
  connection = mysql.connector.connect(
      user="xxxxx", password="xxxxx", host="xxxxx", database="xxxx"
  )
  
  cur = connection.cursor(buffered=True)
  
  sql = "SELECT count(*) FROM inmuebles_test"
  
  try:
      cur.execute(sql)
      results = cur.fetchall()
      for row in results:
          count = row[0]
          print("Initially there are %d rows in table" % (count))
  
  except:
      print("Error: unable to fetch data")
  
  cr = csv.reader(open("test.csv", "r", encoding="utf-8"), delimiter=";")
  i = 1
  next(cr)
  for row in cr:
      print(row)
      print("inserting row-%d into Db" % (i))
      # cur.execute("INSERT INTO inmuebles_test VALUES ( %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",row)
      # connection.commit()
      i = i + 1
      if i &gt; 10:
          break
  
  try:
      cur.execute(sql)
      results = cur.fetchall()
      for row in results:
          count = row[0]
          print("Finally there are %d rows in table" % (count))
  
  except:
      print("Error: unable to fetch data")
  
  cur.close()
  connection.close()
  </code></pre>
  
  <p>The code above exports to a csv file and then attempts to import it to the an identical table on a different server.</p>
  
  <pre class="lang-none prettyprint-override"><code>Not enough parameters for the SQL statement
  </code></pre>
  
  <p>This error occurs even when I import to a table with just two just two columns change line 70 to the following:</p>
  
  <pre><code>cur.execute("INSERT INTO inmuebles_test (id, referencia) VALUES ( %s, %s )",row)
  </code></pre>
  
  <p>If I comment out lines 70-71, then below is an example of a row which is printed out on like 68:</p>
  
  <pre class="lang-none prettyprint-override"><code>['6', '203-5938855', '203', '', '1', 'BLASCO IBAÑEZ', '15', '', '', '', '', '', '', '30027', '', '30', '30500', '1', '1', '1', '1970', '69.0', '0.0', '3', '1', '0', '1', '27718.0', '2018-09-05',
  '35968.0', '2017-01-13', '27718.0', '2018-09-05', '', '0.0', '', 'El inmueble (PISO) se encuentra situado en el municipio de Molina de Segura (MURCIA). La vivienda está ubicada en un edificio de
  un edificio de cuatro alturas. La vivienda se distribuye en tres dormitorios, salón-comedor, cocina, un cuarto de baño.', 'https://www.haya.es/vivienda-5938855/', '4', '2017-01-13', '38.060558',
  '-1.215763', '', '0', '', 'TAU801688', 'Jennifer de Gea', 'BANKIA', 'G', '0.0', '', '1', '0.0', '2018-12-28 16:32:59', '2018-12-28 16:32:59', 'http://www.outletdeviviendas.com/estaticos/imagen.asp?f=685327_203-5938855_1.jpg&amp;c=144']
  </code></pre>