I have using the SQLite3 to insert the multiple records with the placeholder, however I have encounter the above issues.
However, when I run the code it was appear the error
"
InterfaceError: Error binding parameter 0 - probably unsupported type."
My code are as follow:
What I have tried:
<pre lang="Python">
import sqlite3
conn = sqlite3.connect("my_db.db")
c = conn.cursor()
print("SQLite database connected")
my_data = [
(None, 'Sarah', 'Six', 78, 'Female'),
(None, 'Davis', 'Four', 55, 'Male'),
(None, 'Ronald', 'Three', 89, 'Male'),
(None, 'Sarah', 'Nine', 94, 'Female'),
(None, 'Peter', 'Seven', 88, 'Male')
]
c.execute("INSERT INTO student VALUES(?,?,?,?,?)", my_data)
print("f'{c} Student record was added")
conn.commit()
conn.close()
print("id of last row added:", c.rowcount)
How should I resolve?