Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Help with utl_file package
I recommend you put an exception block to cathc the error
EXCEPTION
WHEN NO_DATA_FOUND THEN DBMS_OUTPUT.PUT_LINE('no_data_found'); UTL_FILE.FCLOSE(file_handle); WHEN UTL_FILE.INVALID_PATH THEN DBMS_OUTPUT.PUT_LINE('UTL_FILE.INVALID_PATH'); UTL_FILE.FCLOSE(file_handle); WHEN UTL_FILE.READ_ERROR THEN DBMS_OUTPUT.PUT_LINE(' UTL_FILE.READ_ERROR'); UTL_FILE.FCLOSE(file_handle); WHEN UTL_FILE.WRITE_ERROR THEN DBMS_OUTPUT.PUT_LINE('UTL_FILE.WRITE_ERROR'); UTL_FILE.FCLOSE(file_handle); WHEN OTHERS THEN DBMS_OUTPUT.PUT_LINE('other stuff'); UTL_FILE.FCLOSE(file_handle); END;
Seigmund Akinwande Johnson wrote in message ...
>Help,
>I am trting to write to a text file from pl/sql and I keep gettin this
error
>
>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 line 5
>
>I set the following in my init.ora
># added to access any o/s fril using UTL_FILE module
>utl_file_dir = c:\
>
>
>begin
> declare
> f_handle utl_file.file_type ;
> begin
> f_handle := utl_file.fopen ('c:\' , 'text', 'w' ) ;
> utl_file.put (f_handle, 'Hello ') ;
> utl_file.fclose(f_handle) ;
> end ;
>end;
>/
>
>--
>Developer Preserve Project
>BSDIS
>773-834-2652
>
>
Received on Fri Jun 18 1999 - 11:10:11 CDT