嘛,這麼少的信息,我也沒有辦法去猜測你需要什麼extamante 。
但以下建議:
create table TABLE1(
"ID1" number not null
, "A1" varchar(20)
, "B1" varchar(20)
, "C1" varchar(20)
, "D1" varchar(20)
)
/
create or replace trigger TG_BIU_TABLE1
after insert or update on TABLE1
for each row
begin
update TABLE2
set A2 = :new.A1
,B2 = :new.B1
where TABLE2.ID2 = :new.ID1;
update TABLE3
set A3 = :new.A1
,B3 = :new.B1
,C3 = :new.C1
,D3 = :new.D1
where TABLE3.ID3 = :new.ID1;
end;
/
create table TABLE2(
"ID2" number not null
, "A2" varchar(20)
, "B2" varchar(20)
)
/
INSERT INTO TABLE2 (ID2, A2, B2) VALUES (1, 'AAA', 'BBB')
/
create table TABLE3(
"ID3" number not null
, "A3" varchar(20)
, "B3" varchar(20)
, "C3" varchar(20)
, "D3" varchar(20)
)
/
INSERT INTO TABLE3 (ID3, A3, B3, C3, D3) VALUES (1, 'AAA', 'BBB', 'CCC', 'DDD')
/
INSERT INTO TABLE1 (ID1, A1, B1, C1, D1) VALUES (1, 'AAA1', 'BBB1', 'CCC1', 'DDD1')
/
你爲什麼要與MySQL標籤?那麼只需在兩個表中執行兩個插入?您不會顯示任何表格模式,觸發代碼等。我們應該如何幫助您? – OldProgrammer
用什麼數據你想更新兩個表?數據來自觸發觸發器的表格? –