我是触发器的新手。我在下面创建了一个触发器:
CREATE OR REPLACE TRIGGER ac01_control_trigg
AFTER INSERT ON AC01_CONTROL_TEST
FOR EACH ROW
DECLARE
BEGIN
IF :NEW.cur_pgm_name = 'LSN' AND :NEW.nxt_pgm_name ='MD' AND :NEW.file_status='RD' THEN
UTL_FILE.Fcopy (:NEW.FILE_PATH,:NEW.FILE_NAME,:NEW.FILE_PATH,'CP.txt');
INSERT INTO AC1_CONTROL_TEST
( FILE_NAME, FILE_PATH,CUR_PGM_NAME,NXT_PGM_NAME,FILE_STATUS )
VALUES (:NEW.FILE_NAME, :NEW.FILE_PATH,:NEW.CUR_PGM_NAME,'MD_MPS',:NEW.FILE_STATUS);
END IF;
END ac01_control_trigg;
创建触发器时没有编译错误。但是当我试图在表中插入一个条目时,我收到以下错误。
ORA-29280: invalid directory path
ORA-06512: at "SYS.UTL_FILE", line 258
ORA-06512: at "SYS.UTL_FILE", line 1167
ORA-06512: at "CNGDB18.AC01_CONTROL_TRIGG", line 4
ORA-04088: error during execution of trigger 'CNGDB18.AC01_CONTROL_TRIGG'
有人可以帮忙吗?
编辑:插入语句如下:
INSERT INTO AC01_CONTROL_TEST
(FILE_NAME, FILE_PATH, CUR_PGM_NAME, NXT_PGM_NAME, FILE_STATUS)
VALUES
('SSMS_FSMS_ID000386_T20081224153437_OFWPAC_OMG011.DAT', '/dhiusr3/sub/cng/cngwrk18/var/m3g/projs/up/data/MAF_SMS/20091216/13/15490000/', 'LSN', 'MD', 'RD');
在 unix 上:
0> pwd
/dhiusr3/sub/cng/cngwrk18/var/m3g/projs/up/data/MAF_SMS/20091216/13/15490000