RE: UTL_File -- invalid path error

  • From: "FOX, Simon" <Simon.FOX@xxxxxxxxxxxxxxxxxx>
  • To: "'oracle-l@xxxxxxxxxxxxx'" <oracle-l@xxxxxxxxxxxxx>
  • Date: Mon, 16 Feb 2004 09:39:53 +0000

Have you just moved from 8 to 9?

The system has changed completely.

Look up Directory.  Come back if you need examples.

Simon Fox

CRH

0161 601 8723


-----Original Message-----
From: Maryann Atkinson [mailto:maryann_30@xxxxxxxxx]
Sent: 14 February 2004 21:26
To: Oracle-L@xxxxxxxxxxxxx
Subject: UTL_File -- invalid path error


Would anyone happen to know why the code below the dashed line
gives as error the following 3 lines?

 > Right before opening the file
 > Invalid Path Error      1 User-Defined Exception
 > PL/SQL procedure successfully completed.

Both my
C:\oracle\admin\Oracle9i\pfile\init.ora    as well as my
C:\oracle\admin\Ora9i\pfile\init.ora

files, have the line:

utl_file_dir=c:\\
somewhere towards the bottom...

thx
maa

----------------------------------------------------------------------------
---------------------------------------------
DECLARE
    InFile       UTL_FILE.File_Type;
    InputLine    VARCHAR2(1022);

   BEGIN
        dbms_output.put_Line('Before Opening the file');

        InFile := UTL_FILE.FOPEN('C:\', 'FILEIO.TXT', 'R');

        DBMS_Output.Put_Line('After the FileOpen');


        LOOP
           BEGIN
               UTL_FILE.GET_LINE(InFile, InputLine);

               DBMS_Output.Put_Line(InputLine);

           EXCEPTION
                   WHEN NO_DATA_FOUND THEN EXIT;
           END;
        END LOOP;

        UTL_FILE.FCLOSE(InFile);

        DBMS_Output.Put_Line('Execution Ends.');

   EXCEPTION
        WHEN UTL_File.Invalid_Path THEN
             DBMS_Output.Put_Line('Invalid Path Error      ' 
||   TO_CHAR(SQLCODE)
                                  || ' ' || SQLErrM);
        WHEN UTL_File.Invalid_Mode THEN
             DBMS_Output.Put_Line('Invalid Mode Error      ' 
||   TO_CHAR(SQLCODE)
                                  || ' ' || SQLErrM);
        /**/
        WHEN UTL_File.Invalid_Operation THEN
             DBMS_Output.Put_Line('Invalid Operation Error ' 
||   TO_CHAR(SQLCODE)
                                  || ' ' || SQLErrM);
        WHEN UTL_File.Internal_Error THEN
             DBMS_Output.Put_Line('Internal Error          ' 
||   TO_CHAR(SQLCODE)
                                  || ' ' || SQLErrM);
        WHEN OTHERS THEN
             DBMS_Output.Put_Line('Error ' || To_Char(SQLCODE)
                                  || ' '   || SQLErrM);
   END;
/

----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at //www.freelists.org/archives/oracle-l/
FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------


___________________________________________________________________________

This e-mail and the documents attached are confidential and intended solely
for the addressee; it may also be privileged. If you receive this e-mail in
error, please notify the sender immediately and destroy it. As its integrity
cannot be secured on the Internet, the Atos Origin group liability cannot be
triggered for the message content. Although the sender endeavours to maintain
a computer virus-free network, the sender does not warrant that this
transmission is virus-free and will not be liable for any damages resulting
from any virus transmitted. 
___________________________________________________________________________

----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at //www.freelists.org/archives/oracle-l/
FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------

Other related posts: