Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: UTL_FILE PACKAGE NOT WORKING PLEASE HELP..
Aamer Akbar Janjua wrote:
> I am trying to use UTL_FILE built in package. Its is not working.
> Please
>
> Help me. The error and my code is as under. Any help will be highly
>
> Appreciated .
>
> Thanking you in advance.
>
> AAJ
>
> The error message:-
>
> *****************************************************
> SQL> execute text_file1;
> begin text_file1; end;
>
> *
> ERROR at line 1:
> ORA-06510: PL/SQL: unhandled user-defined exception
> ORA-06512: at "SYS.UTL_FILE", line 82
> ORA-06512: at "SYS.UTL_FILE", line 120
> ORA-06512: at "SYS.TEXT_FILE1", line 17
> ORA-06512: at line 1
>
> The code of the procedure
>
> ********************************
> PROCEDURE text_file1 IS
>
> file_in UTL_FILE.FILE_TYPE;
> file_out UTL_FILE.FILE_TYPE;
> my_var NUMBER;
> line_buf VARCHAR2(50);
> line_out VARCHAR2(1023);
> ctr Number:=1;
>
> cursor c1 is
>
> select name from mstsys.basicdata where pano between 21100 and
> 21130;
>
> BEGIN
> file_out := UTL_FILE.FOPEN('e:\', 'my_file.txt', 'w');
>
> for d1 in c1 loop
>
> line_buf:=d1.name;
>
> UTL_FILE.PUTF(File_out,'%s \n',Line_buf);
>
> end loop ;
>
> UTL_FILE.Fclose(File_out);
>
> END;
You will have to define the directories that UTL_FILE needs acces to in
init.ora for you instance.
Allan Received on Sun Aug 02 1998 - 13:49:56 CDT
![]() |
![]() |