Does anyone know a way (perhaps I'm overlooking it) to make the
If there isn't a 'built-in' way, I'd like to suggest this as a feature!
asked 10 Jan '12, 16:30
AFAIK, INSERT ON EXISTING does rely on the primary key.
However, the much more powerful MERGE statement - available with v11 and above - can be used with different key sets, cf. this FAQ. Furthermore, it's part of the SQL/2008 standard whereas the INSERT ON EXISTING clause is not.
Based on Volkers answer here an example how to use the merge statement with static values and no source table:
merge into target using (select 'NewName' c1) as sourceData on target.name=sourceData.c1 when matched then skip when not matched then insert ( "Name" , "Description" ) values ('NewName','test')