Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
I want to how to write to a file using UTL_FILE.I wrote the following code but its giving the error as follows:
ERROR at line 1:
ORA-20000: ERROR:Invalid path for file or path not in INIT.ORA.
ORA-06512: at line 12
and my code is
DECLARE
filehandler UTL_FILE.FILE_TYPE;
BEGIN
dbms_output.put_line('begin');
filehandler:=UTL_FILE.FOPEN('/','example','w');
dbms_output.put_line('begin1');
UTL_FILE.PUT_line(filehandler,'welcome!!!!!\n');
dbms_output.put_line('begin2');
UTL_FILE.FCLOSE(filehandler);
EXCEPTION
WHEN utl_file.invalid_path THEN
raise_application_error(-20000,'ERROR:Invalid path for file or path not in INIT.ORA.');
END;
/
Please tell me how to give the directory name.I dont have privilege to create a new directory so what i have to do and where to write the file.Thanks,
Roopa.A

Hi,
filehandler:=UTL_FILE.FOPEN('/','example','w');
^-that is not an windows directory ('c:\')in the init.ora file you have also to insert UTL_FILE_DIR = 'c:\'
Maybe in the init.ora is an value for UTL_FILE_DIR, so you have to insert this as the FOPEN(''.... Parameter.
kind regards
Pascal

![]() |
Need help with WinXP batc...
|
Windows 2000 >> Batch fil...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |