Re: Indexing with MySql
Date: April 19, 2011 05:47AM
1) Why not use "CREATE TABLE IF NOT EXITS .." ? I also don't see the need of two tables. Just make one, and put PRIMARY KEY (mac). This means MACs will be unique.
2) You can try to insert the data and catch the exception when a duplicate key is found:
cur.execute("INSERT INTO data (mac,..) VALUES ('newmacaddress',..)
# Do something when the MAC was already in the table
# Do something when the MAC was newly inserted
Sorry for the late reply, but I hope it helps anyways.
Software Developer at Oracle
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.