I have dyanamically built a Merge statement and I am trying to do an Execute Immediate on it. I am able to run the Merge statement individually without issues.
When the same is done through the Execute Immediate it fails: ORA-00001: unique constraint (GPS.DETAILS37150433_PK) violated.
MERGE INTO DETAIL37150433 dp USING ( SELECT 208670 as id FROM dual) dp1 ON ( dp.ID = dp1.id ) WHEN MATCHED THEN UPDATE SET PhaseNumber='2' WHEN NOT MATCHED THEN INSERT (ID,PROGRESSTYPE,CONTRACT, PhaseNumber) VALUES (208670,185890,37150433,'EA');
Any pointer would help.
Thanks
Ram
When the same is done through the Execute Immediate it fails: ORA-00001: unique constraint (GPS.DETAILS37150433_PK) violated.
MERGE INTO DETAIL37150433 dp USING ( SELECT 208670 as id FROM dual) dp1 ON ( dp.ID = dp1.id ) WHEN MATCHED THEN UPDATE SET PhaseNumber='2' WHEN NOT MATCHED THEN INSERT (ID,PROGRESSTYPE,CONTRACT, PhaseNumber) VALUES (208670,185890,37150433,'EA');
Any pointer would help.
Thanks
Ram