Sqlite3: InterfaceError: Error binding parameter 2 -probably unsupported type
<pre><code>c.execute("INSERT INTO sensors values(?,?,?)",
((format(datetime.now().strftime('%d-%m-%Y %H:%M:%S')),
 pydata['id'], pydata['data'])))
</code></pre>

<p>The output:</p>

<pre><code>$ python filterUDPListen.py 
Time: 23-01-2016 12:59:13 Device: AA Data: TEMP017.9
Traceback (most recent call last):
File "filterUDPListen.py", line 71, in &lt;module&gt;
c.execute("INSERT INTO sensors values(?,?,?)",((datetime.now().strftime('%d-%m-%Y %H:%M:%S')), pydata['id'], pydata['data']))
sqlite3.InterfaceError: Error binding parameter 2 - probably unsupported type.
</code></pre>

<p>I keep getting different error while altering this code. Can anyone point me in the right direction off what is wrong here?</p>

<p>The total code:</p>

<pre><code>while True:
data, addr = sock.recvfrom(1024*8)
pydata = json.loads(data)
if pydata['type'] == 'WirelessMessage':
    if len(sys.argv) == 3:
        if pydata['network'] != sys.argv[2]:
            continue
    if len(sys.argv) &gt;= 2:
        if pydata['id'] == sys.argv[1]:
    now = time()
            timediff = now - lasttime
    lasttime = now
            print("Device: {} Data: {} Time: {} Network: {} Timesince: {}".format(pydata['id'], pydata['data'][0], pydata['timestamp'], pydata['network'], timediff))
    else:
        print("Time: {} Device: {} Data: {}".format (datetime.now().strftime('%d-%m-%Y %H:%M:%S'), pydata['id'], pydata['data'][0]))
        c.execute("INSERT INTO sensors values(?,?,?)",((format(datetime.now().strftime('%d-%m-%Y %H:%M:%S')), pydata['id'], pydata['data'])))
        conn.commit()
        conn.close()
</code></pre>

<p>Thanks</p>