I'm trying to update a row of a oracle table, the value of update is in an other table. In the first table I have two rows who can determine in the second table the value.
I try to make these two sentences:
merge into participacion pn
using(
select valor_documento,id_tipo_documento,id_participante from
participantes
) par
on (
pn.valor_documento=par.valor_documento
and pn.id_tipo_documento=par.id_tipo_documento
)
WHEN MATCHED THEN UPDATE
SET pn.id_participante = par.id_participante
or:
Update participacion pa set id_participante=(select id_participante
from participante where valor_documento=pa.valor_documento and id_tipo_documento=pa.id_tipo_documento)
In both cases the update cost a lot of time because I have 500000 rows in a table and more than 3500000 rows in the other one.
Do you have another idea about how to make this update?