触发错误:=ORA-04079: 无效的触发规范
触发错误:=ORA-04079: 无效 触发规范
导致该错误的代码如下:
CREATE OR REPLACE TRIGGER TRGBILLINGADDRESS
AFTER INSERT OR DELETE OR UPDATE ON TBLMACCOUNTADDRESS
add1 wom.tbltaddress.address1%TYPE;
add2 wom.tbltaddress.address2%TYPE;
cityid wom.tbltaddress.city_id%TYPE;
stateid wom.tbltaddress.state_id%TYPE;
pincd wom.tbltaddress.pincode%TYPE;
BEGIN
SELECT address1,address2,city_id,state_id,pincode
INTO add1,add2,cityid,stateid,pincd FROM wom.tbltaddress ta WHERE ta.ID IN (
SELECT vbac.billing_address_id
FROM wom.vw_billaddresschange vbac, wom.tbltaddress ita
WHERE vbac.billing_address_id = ita.ID
AND vbac.lcid = parlcid);
IF add1 = :NEW.address1 AND add2 = :NEW.address2 AND cityid = :NEW.cityid AND stateid = :NEW.stateid AND pincode = :NEW.zip THEN
dbms_output.put_line('Address Already Exist in tbltaddress table');
ELSE
UPDATE wom.tbltaddress ta
SET ta.address1 = :NEW.address1,
ta.address2 = :NEW.address2,
ta.city_id = :NEW.cityid,
ta.country_id = 'CTR0001',
ta.state_id = :NEW.stateid,
ta.pincode = :NEW.zip
WHERE ta.ID IN (
SELECT vbac.billing_address_id
FROM wom.vw_billaddresschange vbac, wom.tbltaddress ita
WHERE vbac.billing_address_id = ita.ID
AND vbac.lcid = parlcid);
END IF;
END;
trigger error:=ORA-04079: invalid
trigger specification
the code causing that error is below:
CREATE OR REPLACE TRIGGER TRGBILLINGADDRESS
AFTER INSERT OR DELETE OR UPDATE ON TBLMACCOUNTADDRESS
add1 wom.tbltaddress.address1%TYPE;
add2 wom.tbltaddress.address2%TYPE;
cityid wom.tbltaddress.city_id%TYPE;
stateid wom.tbltaddress.state_id%TYPE;
pincd wom.tbltaddress.pincode%TYPE;
BEGIN
SELECT address1,address2,city_id,state_id,pincode
INTO add1,add2,cityid,stateid,pincd FROM wom.tbltaddress ta WHERE ta.ID IN (
SELECT vbac.billing_address_id
FROM wom.vw_billaddresschange vbac, wom.tbltaddress ita
WHERE vbac.billing_address_id = ita.ID
AND vbac.lcid = parlcid);
IF add1 = :NEW.address1 AND add2 = :NEW.address2 AND cityid = :NEW.cityid AND stateid = :NEW.stateid AND pincode = :NEW.zip THEN
dbms_output.put_line('Address Already Exist in tbltaddress table');
ELSE
UPDATE wom.tbltaddress ta
SET ta.address1 = :NEW.address1,
ta.address2 = :NEW.address2,
ta.city_id = :NEW.cityid,
ta.country_id = 'CTR0001',
ta.state_id = :NEW.stateid,
ta.pincode = :NEW.zip
WHERE ta.ID IN (
SELECT vbac.billing_address_id
FROM wom.vw_billaddresschange vbac, wom.tbltaddress ita
WHERE vbac.billing_address_id = ita.ID
AND vbac.lcid = parlcid);
END IF;
END;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在声明变量之前,您应该使用
DECLARE
。You should use
DECLARE
before declaring your variables.