Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using UTL_FILE

Status
Not open for further replies.

sweetleaf

Programmer
Jan 16, 2001
439
CA
Hi there,

I have a stored procedure that
1) reads in a text file then updates and inserts accordingly,
2) and then is supposed
to write entries into an exception log under certain conditions that i define.

so far the SP is doing what it is supposed to except for one thing: when writien out to the exception file each entry "wipes" out the previous one so that if there are supposed to be 5 entries only the last one gets written out!

I have tried using utl_file.is_open to determine if the file is already open and if so to not re-open it - but the same problem persists...

any and all help would be greatly appreciated!
Thanks.
 
you might want to try flushing your buffer after each put line :

UTL_FILE.FFLUSH(l_output_file);
 
If you are opening the file each time you write to it, make sure you are opening in "append" mode, otherwise the file will be recreated each time it is opened:
Code:
   v_handle := utl_file.fopen (v_path, v_file, 'a');
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top