How do I use prepared statements for inserting MULTIPLE records in SQlite using Python / Django?

Official Python library documentation: Cursor objects

Python’s SQLite libraries don’t have prepared statement objects, but they do allow you to use parameterized queries, and to provide more than one set of parameters.

Edit: An example of executemany as requested:

values_to_insert = [(1,"foo"), (2, "bar"), (3, "baz")]

cursor.executemany("""
    INSERT INTO some_table ('item_num', 'item_name')
    VALUES (?, ?)""", values_to_insert)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)