I’m using this code in Python:
for ... :
cursor.execute('INSERT OR IGNORE INTO foo (bar,baz) VALUES (?, ?)',(1,3))
con.commit()
Can I get the value of the number of rows that have been inserted without using if statement and testing if the value existed before insert?
To get number of rows inserted,
cursor.rowcountshould return the number of rows affected by the last execute ( in this case, number of inserts).