MySQL Forums
Forum List  »  Sybase

Insert Ignore / On Duplicate Key - Conversion
Posted by: Jim Taylor
Date: February 24, 2012 12:11PM

I am in the middle of converting an application from using SQLAnywhere and trying to figure out the best way to adjust for a very useful feature in SQLAnywhere. For insert there is an "On EXISTING" feature where one can ERROR, SKIP or UPDATE. For most situations the Insert Ignore and On Duplicate works okay. Where I am having trouble are cases where I am doing something like:

insert into table_name (id, name, address) values select id, name, address from table_name2

and I want update if it already exists. Am I missing some functionality that would allow me to have it update based on my select list? Or, my update list itself instead of having to repeat stuff using ON DUPLICATE KEY? While the ON DUPLICATE KEY provides some flexibility that SQLAnywhere doesn't have it is also far more unwieldy when I simply want to update with the data provided in the insert values. Which is normally the case.

Obviously I may just be overlooking something.

Thank you for any suggestions you can provide.

Jim

Options: ReplyQuote


Subject
Views
Written By
Posted
Insert Ignore / On Duplicate Key - Conversion
5454
February 24, 2012 12:11PM


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.