急急急!oracle触发器如何写A表插入数据 B表更新某字段
A表和B表有一个相同字段contract_Id我这样子写但是写完后会有个差号也不知道那不对CREATEorreplaceTRIGGERtri_contract_zfaft...
A表和B表有一个相同字段 contract_Id
我这样子写但是写完后会有个差号也不知道那不对
CREATE or replace TRIGGER tri_contract_zf
after INSERT ON gfxt_bill
FOR EACH ROW
BEGIN
UPDATE gfxt_contract
SET gfxt_contract.contract_zt ='提单开出'
WHERE gfxt_bill.contract_id = gfxt_contract.contract_id;
END; 展开
我这样子写但是写完后会有个差号也不知道那不对
CREATE or replace TRIGGER tri_contract_zf
after INSERT ON gfxt_bill
FOR EACH ROW
BEGIN
UPDATE gfxt_contract
SET gfxt_contract.contract_zt ='提单开出'
WHERE gfxt_bill.contract_id = gfxt_contract.contract_id;
END; 展开
展开全部
CREATE or replace TRIGGER tri_contract_zf
after INSERT ON gfxt_bill
FOR EACH ROW
BEGIN
UPDATE gfxt_contract
SET contract_zt ='提单开出'
WHERE contract_id=:ROW.contract_id;
END;
after INSERT ON gfxt_bill
FOR EACH ROW
BEGIN
UPDATE gfxt_contract
SET contract_zt ='提单开出'
WHERE contract_id=:ROW.contract_id;
END;
追问
但是创建完后 triggers 里 那个 触发器有个错号,添加数据时报触发器错误
追答
CREATE or replace TRIGGER tri_contract_zf
after INSERT ON gfxt_bill
FOR EACH ROW
BEGIN
UPDATE gfxt_contract
SET contract_zt ='提单开出'
WHERE contract_id=:NEW.contract_id;
END;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询