on 2012 Jan 10 4:30 PM
Does anyone know a way (perhaps I'm overlooking it) to make the ON EXISTING SKIP
syntax check Alternate Keys?
If there isn't a 'built-in' way, I'd like to suggest this as a feature!
Thanks, Calvin
Request clarification before answering.
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')
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
29 | |
9 | |
8 | |
7 | |
7 | |
7 | |
6 | |
6 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.