Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

what happens, if I open a file (foo := utl_file.fopen(... ), write multiple times to a file ( utl_file.put_line (foo,bar) ) and close it ( utl_file.fclose(foo) ) without any flushing?

Is there a difference between the versions 10g and 11g? Is the output deterministic?

Thank you

Edit 1: I am asking because we got some missing characters in a huge output file at some points where the 7FFF (= 32767) byte is full and the 32768th byte would be written. This error exists only since the update from 10g to 11g. The error in the code might be a missing flush, but we don't get any exceptions and it was working before the update. The issue is not with every 32768th byte.

share|improve this question
Is there a reason you don't want to flush or are you just curious? – Jack Douglas Dec 4 '13 at 15:46
We had some buggy code, which worked without flushing on 10g but on 11g we get this error. So I tried to figure out what caused the error. We tried to write two files (one with flush, one without) but the error is in both files – user30137 Dec 13 '13 at 12:08

According to the documentation for





If there is buffered data yet to be written when FCLOSE runs, then you may receive a WRITE_ERROR exception when closing a file.

So you should call utl_file.fflush(foo); before closing.

share|improve this answer
Thank you for your post. I added some more text for clarification. Please see "Edit 1". – user30137 Nov 4 '13 at 12:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.