I need to insert new rows into an oracle(12c) SQL table only if they don't exists using java code It is possible that there will be more then 100 rows to check and insert
ideally I would like to have one merge statement with multiple inserts something like this:
MERGE INTO some_table t
USING(???)
ON(???)
WHEN MATCHED THEN UPDATE ???
WHEN NOT MATCHED THEN INSERT (t.id, t.val)
value("some_id","some_data")
...
...
...
but I have trouble with syntax and i can't find any examples for this case ether
I would like to know:
- if this even possible
- if yes, is it the correct way to go or there is a better solution
- what should be the syntax(some example will be great)
- if it not possible than what is the correct way.
thanks for help