copy all values of fields on Update
My problem is...
I have 2 tables, lojas and lojas_cp. So, i created this trigger to make a automatic update in table lojas_cp. But when i change just one field on table lojas... the others fields of table lojas_cp are changed too and it receive value default of table.
Anybody knows .. how i can solver the problem.
Create trigger updateLojas after update on producao.lojas
for each row begin
update test.lojas_cp set loja_nome = new.loja_nome,loja_cnpj = new.loja_cnpj where loja_numero = new.loja_numero;
if (row_count() = 0) then
insert into test.lojas_cp set loja_numero = new.loja_numero,loja_nome = new.loja_nome,loja_cnpj = new.loja_cnpj;
end if;
END |
Edited 1 time(s). Last edit at 05/22/2006 09:11AM by Edvaldo Panta.
Subject
Views
Written By
Posted
copy all values of fields on Update
6487
May 22, 2006 09:09AM
2490
May 22, 2006 10:18AM
2512
May 22, 2006 10:29AM
2358
May 22, 2006 12:38PM
2705
May 22, 2006 05:08PM
2014
May 23, 2006 08:04AM
2262
May 23, 2006 10:32AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.