I have an SQL MERGE statement working perfectly in Oracle 11g (development environment), but it gives me the following error when I try to run it in Oracle 9i (Production environment): ORA-00905: missing keyword.
Is there any way to make this work in Oracle 9i? Here is statement:
MERGE INTO non_asset dst
USING (SELECT tag, comments, computer_role
FROM non_asset_backup
WHERE sub_group = 'AALVOIP') src
ON (dst.tag = src.tag)
WHEN MATCHED THEN
UPDATE
SET dst.comments = src.comments,
dst.computer_role = src.computer_role
In 9i both the
WHEN MATCHEDand theWHEN NOT MATCHEDbranches were mandatory. In 10g and after one of them can be missing (but not both, obviously).See http://docs.oracle.com/cd/B10501_01/server.920/a96540/statements_915a.htm#2080942 vs. http://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_9016.htm#i2081218