MERGE INTO table1 t USING
(SELECT '000004' AS SENDER,'Receiver' AS RECEIVER,'1030' AS IDENTIFIER,'2016' AS CREATIONDATEANDTIME,'2' AS ACKCODE,'Test' AS ACKDESCRIPTION
FROM table1) s ON(t.SENDER = s.SENDER
AND t.IDENTIFIER = s.IDENTIFIER) WHEN MATCHED THEN
UPDATE
SET t.CREATIONDATEANDTIME = '1213',
t.RECEIVER = 'hello' WHEN NOT MATCHED THEN
INSERT (t.SENDER,
t.RECEIVER,
t.IDENTIFIER,
t.CREATIONDATEANDTIME,
t.ACKCODE,
t.ACKDESCRIPTION)
VALUES (s.SENDER,
s.RECEIVER,
s.IDENTIFIER,
s.CREATIONDATEANDTIME,
s.ACKCODE,
s.ACKDESCRIPTION)
Output of query: scenario 1: When there is no data matching the condition(t.SENDER = s.SENDER and t.IDENTIFIER = s.IDENTIFIER), I get an error as follows ORA-30926: Unable to get stable set of rows in the source tables. Cause: A stable set of rows could not be got because of large dml activity or a non-deterministic activity where clause. Action: Remove any non-deterministic where clause and reissue dml
Scenario 2: When there is data matching the condition (t.SENDER = s.SENDER and t.IDENTIFIER = s.IDENTIFIER) then in the table, I can see 5 new entries.
Can you please help