Re: UTL_FILE : invalid_path error
Date: 12 Mar 2002 14:16:12 -0800
Message-ID: <a6lunc0175e_at_drn.newsguy.com>
In article <4a5a78d4.0203120845.6488c1e5_at_posting.google.com>,
adityanath_at_hotmail.com says...
>
>Hi!
>
>I am trying to use utl_file package.
>My Oracle is on SunOS
>
>I have put in the following line in init.ora
>
>utl_file_dir = *
>
>I have restarted the Oracle server
>
show us the output of this script WHEN RUN ON THE SERVER THE DATABASE IS ON!
show parameter utl
!ls -ldg /u12 !ls -ldg /u12/dashboard !ls -l /u12/dashboard/Error.txt
my thoughts:
o utl_file_dir isn't really set to what you believe
o /u12 doesn't exist on the server the database resides on OR is not
readable/executable by the oracle software owner (who the database runs as)
o or /u12/dashboard has that problem
o or /u12/dashboard/Error.txt already exists, and is not writable by the oracle
software owner
(and rick's advice is sound, don't use *, I'll open your system.dbf in 'w' someday and erase it on you!)
>And my code is
>
>Create Or Replace Procedure sp_report_data
>IS
>ls_string varchar2(1000);
>file_id UTL_FILE.FILE_TYPE;
>Begin
> dbms_output.put_line ('before open');
> file_id := UTL_FILE.FOPEN ('/u12/dashboard', 'Error.txt', 'W');
> dbms_output.put_line ('after open');
> ls_string := 'data uploaded successfully';
> UTL_FILE.PUT (file_id,ls_string);
> UTL_FILE.FCLOSE (file_id);
>
> EXCEPTION
> WHEN UTL_FILE.INVALID_PATH THEN
> dbms_output.put_line('path not valid');
> WHEN UTL_FILE.INVALID_MODE THEN
> dbms_output.put_line('file mode not valid');
> WHEN UTL_FILE.INVALID_OPERATION THEN
> dbms_output.put_line('file operation not valid');
>End;
>
>It is going into the exception UTL_FILE.INVALID_PATH
>just after UTF_FILE.FOPEN statement.
>
>Any suggestion is highly appretiated.
>
>Regards,
>Aditya
>adityanath_at_hotmail.com
-- Thomas Kyte (tkyte_at_us.oracle.com) http://asktom.oracle.com/ Expert one on one Oracle, programming techniques and solutions for Oracle. http://www.amazon.com/exec/obidos/ASIN/1861004826/ Opinions are mine and do not necessarily reflect those of Oracle CorpReceived on Tue Mar 12 2002 - 23:16:12 CET