Hello, community members, I ran into the problem that I need to execute a sql query, like this: (python 3.5, sqlite)
cur = db.cursor() cur.execute("CREATE TABLE contact_info(ID INTEGER PRIMARY KEY autoincrement," firstname VARCHAR(60), lastname VARCHAR(60), middlename VARCHAR(60)," "UNIQUE (firstname, lastname, middlename) ON CONFLICT REPLACE);") cur.execute("INSERT OR REPLACE INTO contact_info VALUES" "((SELECT ID FROM contact_info WHERE firstname=? AND" "lastname=? AND middlename=?), ?, ?, ?);", [fname, lname, mname, fname, lname, mname]) After that, I need to know whether INSERT or REPLACE was executed, but I do not understand how this can be done without writing additional requests. And I would like to understand how the most correct thing is to find out?
sqldoes not swear at impossibility to execute request? Usually, after all, an exception is thrown ... - gil9redbooleanflagand set it toTruewhen the condition is met, and then just do a check - A. Shorokhov