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
Subject
Views
Written By
Posted
Insert Ignore / On Duplicate Key - Conversion
6428
February 24, 2012 12:11PM
3218
February 25, 2012 03:22AM
3288
February 25, 2012 08:49AM
3534
February 25, 2012 10:08AM
2970
February 25, 2012 04:34AM
3085
February 25, 2012 02:57PM
2756
February 25, 2012 04:27PM
2865
February 28, 2012 01:17AM
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.