› Fóruns › SQL e PL/SQL › UPDATE COMPARANDO DUAS TABELAS › UPDATE COMPARANDO DUAS TABELAS
3 de maio de 2010 às 9:05 pm
#93864
Participante
Caro Miro,
Updates não funcionam com junções de tabelas, tente fazer uma subquery.
Declare
Cursor c_SQL is
Select tabela1.endrua,
tabela2.endfil
from tabela1,
tabela2
where tabela1.numemp = tabela2.numemp
and tabela1.numemp = 12
and tabela1.numcad = 204;
Begin
for v_SQL in c_SQL loop
update tabela1 set v_SQL.endrua = v_SQL.endfil;
end loop;
commit;
End;
abs
Yves Plansson