UTL_File -- invalid path error

  • From: Maryann Atkinson <maryann_30@xxxxxxxxx>
  • To: Oracle-L@xxxxxxxxxxxxx
  • Date: Sat, 14 Feb 2004 16:25:35 -0500

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
-----------------------------------------------------------------

Other related posts: