Home » SQL & PL/SQL » SQL & PL/SQL » utl_file error (XP,Oracle 10g)
utl_file error [message #315221] Sun, 20 April 2008 02:15 Go to next message
swas_fly
Messages: 220
Registered: March 2008
Location: Bhubaneswar
Senior Member
CREATE DIRECTORY test_dir AS 'c:\';

Create or replace procedure Pr_utl
as
  fileHandler UTL_FILE.FILE_TYPE;
BEGIN
  fileHandler := UTL_FILE.FOPEN('test_dir', 'test_file.txt', 'W');
  UTL_FILE.PUTF(fileHandler, 'Look ma, I''m writing to a file!!!\n');
  UTL_FILE.FCLOSE(fileHandler);
EXCEPTION
  WHEN utl_file.invalid_path THEN
     raise_application_error(-20000, 'ERROR: Invalid path for file.');
END;



exec pr_utl
ORA-20000: ERROR:Invalid path for file.
ORA-06512: at "SCOTT.pr_utl",line 10
ORA-06512: at line 1


the directory contains the following.

TEST_DIR='C:\'

Why it is failing to write??
Re: utl_file error [message #315223 is a reply to message #315221] Sun, 20 April 2008 02:19 Go to previous messageGo to next message
Michel Cadot
Messages: 64120
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
TEST_DIR
test_dir

Do you see the difference?

Regards
Michel
Re: utl_file error [message #315228 is a reply to message #315221] Sun, 20 April 2008 02:39 Go to previous messageGo to next message
swas_fly
Messages: 220
Registered: March 2008
Location: Bhubaneswar
Senior Member
I appologise for writing it wrongly

It is

test_dir='c:\'
Re: utl_file error [message #315231 is a reply to message #315228] Sun, 20 April 2008 02:53 Go to previous message
Michel Cadot
Messages: 64120
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
You don't understand what I meant.
Quote:
CREATE DIRECTORY test_dir AS 'c:\';

The name of the directory is TEST_DIR in upper case.

Regards
Michel
Previous Topic: making the table distinct !
Next Topic: SCHEDULER Program log
Goto Forum:
  


Current Time: Tue Dec 06 12:32:10 CST 2016

Total time taken to generate the page: 0.12004 seconds