Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: UTL_FILE problems.
edreyes77_at_hotmail.com (Ed) wrote in message news:<5bb04c8c.0305131325.3ea6f59a_at_posting.google.com>...
> Can someone explain why I am getting ORA-06510 errors from this code
> snippet? I have the appropriate privileges to read from this directory
> (I think).
>
> Thanks In Advance,
> Ed
>
> SQL> list
> 1 create or replace procedure tp2UpdateCodes
> 2 is
> 3 v_line varchar2(128);
> 4 c_location constant varchar2(80) := '/tmp/';
> 5 c_filename constant varchar2(80) := 'tpcodes.txt';
> 6 v_handle Utl_File.File_Type := NULL;
> 7 begin
> 8 v_handle := UTL_FILE.FOPEN ( c_location,
> 9 c_filename,
> 10 'r',
> 11 32767 );
> 12 loop
> 13 Utl_File.Get_Line ( file => v_handle,
> 14 buffer => v_line );
> 15 Dbms_Output.Put_Line ( v_line || '--' );
> 16 end loop;
> 17 Utl_File.Fclose ( file => v_handle );
> 18 exception
> 19 when no_data_found then null;
> 20* end tp2UpdateCodes;
> SQL> execute tp2UpdateCodes
> BEGIN tp2UpdateCodes; END;
>
> *
> ERROR at line 1:
> ORA-06510: PL/SQL: unhandled user-defined exception
> ORA-06512: at "SYS.UTL_FILE", line 120
> ORA-06512: at "SYS.UTL_FILE", line 293
> ORA-06512: at "ICCONTST2.TP2UPDATECODES", line 8
> ORA-06512: at line 1
Few things,