Suppose that I have the following command, which writes two entries with the same key. So the 1st entry will be overwritten by the 2nd entry. Therefore, there is no need to write the 1st entry. Is sqlite3 smart enough to not to write the 1st entry? Or it will write both the 1st entry and the 2nd entry? Thanks.
conn=sqlite3.connect("my.db") c=conn.cursor() c.execute(''' CREATE TABLE IF NOT EXISTS sqlar( name TEXT PRIMARY KEY , mode INT , mtime INT , sz INT , data BLOB) ''') c.execute('REPLACE INTO sqlar VALUES(?, ?, ?, ?, ?)', ["a", 0, 0, 1, "1"]) c.execute('REPLACE INTO sqlar VALUES(?, ?, ?, ?, ?)', ["a", 0, 0, 1, "2"]) conn.commit() -- Regards, Peng _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users