Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

PL/SQL - Trigger gets UTL_FILE.INVALID_PATH

124 views
Skip to first unread message

TL

unread,
Mar 2, 1998, 3:00:00 AM3/2/98
to

I am trying to use the UTL_FILE.FOPEN, and I get the invalid path error,
even though the D:\ORANT\BWVAUDIT directory is in the Oracle ini file.
code follows...Any ideas?


CREATE OR REPLACE TRIGGER tbw009_log_trigger
AFTER DELETE OR UPDATE ON tbw009_cust
FOR EACH ROW
DECLARE
audit_file UTL_FILE.FILE_TYPE;
file_dir varchar2(255) := 'D:\ORANT\BWVAUDIT\';
file_name varchar2(255) := 'TBW009.AUD';
file_write varchar2(1) := 'w';

BEGIN
DBMS_OUTPUT.PUT_LINE ('Entering the logic.');
audit_file := UTL_FILE.FOPEN(file_dir, file_name, file_write);

IF UTL_FILE.IS_OPEN(audit_file) THEN
UTL_FILE.PUT_LINE(audit_file,
'this line is being added');
END IF;

EXCEPTION
WHEN UTL_FILE.INVALID_PATH THEN
DBMS_OUTPUT.PUT_LINE ('Invalid Path.');

WHEN UTL_FILE.INVALID_MODE THEN
DBMS_OUTPUT.PUT_LINE ('Invalid Mode.');

WHEN UTL_FILE.INVALID_OPERATION THEN
DBMS_OUTPUT.PUT_LINE ('Invalid Operation.');

END;


DTS

unread,
Mar 3, 1998, 3:00:00 AM3/3/98
to

Make sure that you have the utl_file_dir set in yout init.ora file.
If not you will always get the error.

This will give the caller permission to wite to any directory
utl_file_dir = *

This will allow the caller to only write to the directory
utl_file_dir = D:\ORANT\BWVAUDIT

TL <lam...@tiac.net> wrote in article
<01bd4630$890c4860$c74b3dd1@l58cb9>...

Patrick Flahan

unread,
Mar 8, 1998, 3:00:00 AM3/8/98
to

Try taking off the '\' on the file_dir variable.

Patrick Flahan
fla...@leading.net

TL wrote in message <01bd4630$890c4860$c74b3dd1@l58cb9>...

0 new messages