Home > database >  Seek A great god advice trigger table insert A data table B update A field
Seek A great god advice trigger table insert A data table B update A field

Time:09-28



The CREATE or replace the TRIGGER tri_contract_zf
After INSERT ON gfxt_bill
FOR EACH ROW
The BEGIN
The UPDATE gfxt_contract
The SET contract_zt='bill of lading for'
WHERE contract_id=: ROW. Contract_id;

END;

This is the trigger I wrote these two tables have a contract_ID contact field

CodePudding user response:

: new contract_id

CodePudding user response:

The CREATE or replace the TRIGGER tri_contract_zf
After INSERT ON gfxt_bill
FOR EACH ROW
The BEGIN
The UPDATE gfxt_contract
The SET contract_zt='bill of lading for'
WHERE contract_id=: NEW . Contract_id;

END;

Used the trigger, there are two record type
The new and old
Insert data in the new
Delete the old
  • Related