I've isolated my problem down to this code, which is giving me the error message "ORA-00933: SQL command not properly ended" for the on duplicate key line.
I'm trying to insert rows unless they have a duplicate key, in which case I want to update them instead. Something like insert...select and on duplicate key update.
I can see it must be a syntax problem, but I don't normally work with SQL so any help is appreciated.
insert into "tableB" ("col1", "col2")
select "tableA"."colX", "tableA"."colY"
from "tableA"
on duplicate key update "tableB"."col1" = "tableA"."colX";