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!

UTL_FILE.IS_OPEN help

user575115Sep 2 2013 — edited Sep 2 2013

Hi,

In report generation procedure,Before opening the file i'm checking like below,But code review put below comment.Please advice me to incorporate this comment..I have confusion on this comment.

IF UTL_FILE.IS_OPEN (v_csv_file)  THEN

        UTL_FILE.FCLOSE (v_csv_file);

    END IF;

    v_csv_file := UTL_FILE.FOPEN (v_file_location, v_csv_filename, 'W',32767);

code review comment:

1. UTL_FILE is used to check the file is closed before opening it at the start of both %CSV procs.  To me, this is a clear opportunity to encapsulate that check and the exception handling in a separate proc.  That way the code to do the opening and handling is written just once and is used more like a service.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 30 2013
Added on Sep 2 2013
2 comments
1,132 views