0
我有以下代碼片段,它將使用觸發器和存儲過程將數據插入到三個表中,以便由觸發器調用。觸發器和過程都成功編譯。從Oracle中的觸發器調用過程時出現錯誤
CREATE OR REPLACE TRIGGER trigger_insert_attr AFTER
INSERT ON BSCS_WORK_SYNC_INFO FOR EACH ROW BEGIN
bscs_rateplan_sync(:new.project_id , :new.tmcode);
update BSCS_WORK_SYNC_INFO set comp_date=SYSDATE where
project_id=:new.project_id;
END trigger_insert_attr;
/
CREATE OR REPLACE
PROCEDURE bscs_rateplan_sync
(
tmcode_list IN VARCHAR2,
project_id IN VARCHAR2
)
AS
BEGIN
EXECUTE IMMEDIATE 'delete from ecm_mpulktm1 where
project_id='||project_id ;
EXECUTE IMMEDIATE 'delete from ecm_mpulktm2 where
project_id='||project_id ;
EXECUTE IMMEDIATE 'delete from ecm_fup_tariff_work where
project_id='||project_id ;
EXECUTE immediate 'insert into ecm_mpulktm1 select '||project_id||' , m1.*
from [email protected]_bscsprd_rpt m1 where tmcode in
('||tmcode_list||')'
;
EXECUTE immediate 'insert into ecm_mpulktm2 select '||project_id||' , m1.*
from [email protected]_bscsprd_rpt m1 where tmcode in
('||tmcode_list||')'
;
EXECUTE immediate 'insert into ecm_fup_tariff_work select '||project_id||'
, m1.* from [email protected]_bscsprd_rpt m1 where tmcode in
('||tmcode_list||')' ;
END;
/
但是當數據被插入到表BSCS_WORK_SYNC_INFO我得到 以下錯誤:
SQL Error: ORA-00933: SQL command not properly ended ORA-06512: at "ECMREPORT.BSCS_RATEPLAN_SYNC", line 6 ORA-06512: at "ECMREPORT.TRIGGER_INSERT_ATTR", line 2 ORA-04088: error during execution of trigger 'ECMREPORT.TRIGGER_INSERT_ATTR'
有人可以幫助解決這個錯誤嗎?我對PL/SQL相對較新,因此會請求幫助解決上述錯誤。表BSCS_WORK_SYNC_INFO中的數據將由Web服務填充。在執行過程後,表中的數據也將被更新。
請向我們展示進入觸發器的':new.tmcode'的一些值。 – nop77svk