ORA-38104: As colunas mencionadas na cláusula ON não podem ser atualizadas

tenho uma tabela simples com um sinalizador de exclusão (os registros devem ser atualizados nesta coluna em vez de excluídos):

create table PSEUDODELETETABLE
(
  ID        NUMBER(8) not null, -- PKEY
  NAME      VARCHAR2(50) not null,
  ISDELETED NUMBER(1) default 0 not null
)

Ao inserir novos registros, devo verificar se já existe um registro que corresponda à chave primária, mas com ISDELETED = 1. Nesse caso, devo alterar ISDELETED para 0 e atualizar as outras colunas. Portanto, estou usando a seguinte declaração de mesclagem:

merge into ET.PSEUDODELETETABLE TARGET
using (select 1 as ID, 'Horst' as NAME from sys.dual) SOURCE
on (TARGET.ISDELETED = 1 and SOURCE.ID = TARGET.ID)
when matched then
  update set ISDELETED = 0, NAME = SOURCE.NAME
when not matched then
  insert values (SOURCE.ID, SOURCE.NAME, 0);

No Sql-Server, ele funciona muito bem, mas a Oracle diz:

ORA-38104: Columns referenced in the ON Clause cannot be updated: TARGET.ISDELETED

Se houver um registro correspondente com IDELETED = 0, quero a violação da chave primária como uma exceção, é por isso que não consigo mover "TARGET.ISDELETED = 1" da cláusula on para a instrução update.

questionAnswers(6)

yourAnswerToTheQuestion