在下面的代码PL / SQL语句忽略错误发生错误诅咒行是粗体和斜体字体
create or replace
TRIGGER TRGBILLINGADDRESS
AFTER UPDATE ON TBLMACCOUNTADDRESS
FOR EACH ROW
DECLARE
add1 VARCHAR2(100);
add2 VARCHAR2(100);
cityid VARCHAR2(75);
stateid VARCHAR2(75);
pincd VARCHAR2(10);
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;
答案 0 :(得分:3)
您的变量声明为pincd
,而不是pincode
。 pincode
是表格中的字段。