Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Unknown Error With UTL_FILE.FOPEN

3245956Dec 21 2016 — edited Dec 21 2016

I have the code below and it is throwing up an error on the WHEN OTHERS exception.  When I create a file manually and copy the contents of the original file into it I do not get the error

Does anyone know what may be the problem with the original file?  Thanks

   BEGIN

      v_file_name := p_file_name;

      fid:= UTL_FILE.FOPEN (pkg_de_file_utils.get_file_path,v_file_name,'r',1500);

     

    EXCEPTION

      WHEN UTL_FILE.INVALID_PATH then

        v_status     := 'ERROR';

        v_error_msg:='Invalid Path on Open '||p_send_tpart_id;

        EDI.PROC_LOG_ERR(NULL, v_proc_name, v_error_msg );

      WHEN UTL_FILE.INVALID_FILEHANDLE then

        v_status     := 'ERROR';

        v_error_msg:='Invalid File Handle on Open '||p_send_tpart_id;

        EDI.PROC_LOG_ERR(NULL, v_proc_name, v_error_msg );

      WHEN UTL_FILE.INVALID_OPERATION then

        v_status     := 'ERROR';

        v_error_msg:='Invalid Operation on Open '||p_send_tpart_id;

        EDI.PROC_LOG_ERR(NULL, v_proc_name, v_error_msg );

      WHEN UTL_FILE.READ_ERROR then

        v_status     := 'ERROR';

        v_error_msg:='Read Error on Open '||p_send_tpart_id;

        EDI.PROC_LOG_ERR(NULL, v_proc_name, v_error_msg );

      WHEN UTL_FILE.INTERNAL_ERROR then

        v_status     := 'ERROR';

        v_error_msg:='Internal Error on Open '||p_send_tpart_id;

        EDI.PROC_LOG_ERR(NULL, v_proc_name, v_error_msg );

      WHEN OTHERS then

        v_status     := 'ERROR';

        v_error_msg:='Other Exception on Open '||p_send_tpart_id;

        EDI.PROC_LOG_ERR(NULL, v_proc_name, v_error_msg );

    END;

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 18 2017
Added on Dec 21 2016
7 comments
713 views