Re: UTL_FILE paths

From: TL <lamkin_at_tiac.net>
Date: 1998/03/03
Message-ID: <01bd46b8$93b9dc40$2e4e3dd1_at_l58cb9>#1/1


I am having a similar problem on NT. 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, which is called "initorcl.ora" on our db. [Quoted] Code follows...Any ideas? I tried it with and without the last "\".

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; Michael R. Shoop <mshoop_at_zeltech.com> wrote in article <34F6CC06.3FC0D754_at_zeltech.com>...
> In my init.ora file I have --
>
> utl_file_dir = /usr/tmp
>
> which is suppose to define the path into which a file can be opened when
> using the utl_file package. However, in my pl/sql code, when I make a
> call such as
>
> declare
> file_id utl_file.file_type;
> begin
> file_id := utl_file.fopen('/usr/tmp/','test.lis','W');
> ....
> ....
> ...
> the invalid path exception is raised. Any ideas on why this would be?
> The permissions are open on /usr/tmp. When I change the utl_file_dir
> parameter to be
>
> utl_file_dir = *
>
> the fopen command works fine. Again, anyone have a clue why the code is
> not working properly?
>
> Thanks in advance,
>
> Mike Shoop
>
Received on Tue Mar 03 1998 - 00:00:00 CET

Original text of this message