MySQL Forums
Forum List  »  Newbie

Re: Whats the best way to move data?
Posted by: Barry Galbraith
Date: September 18, 2015 09:04PM

The NewProduct and UpdateProduct can be handled in one go with INSERT .... ON DUPLICATE KEY UPDATE ...
if INSERTing would create a duplicate UNIQUE KEY.
http://dev.mysql.com/doc/refman/5.6/en/insert-on-duplicate.html


The DELETE for DeleteProduct, I would do as a DELETE ... LEFT JOIN ... ON ... WHERE ...
in the form of an Exclusion join to find the rows in your product table not matched in your 'xml' table.

Good luck,
Barry.

Options: ReplyQuote


Subject
Written By
Posted
Re: Whats the best way to move data?
September 18, 2015 09:04PM


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.