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!

trailing new lines when writing to file

428477Jul 16 2007 — edited Jul 16 2007
Hello everybody,

is there a way to prevent oracle from putting a new line character at the end of a file?

I am trying to write data to a file and everything works fine..except..Somehow oracle always puts a new line character at the end of the last line. Example:

declare
DownloadFile utl_file.file_type;
BEGIN
DownloadFile := utl_file.fopen('MY_DIRECTORY', 'test'||to_char(sysdate,'yyyy-mm-dd hh24:mi:ss')||'.txt','W',32760);
utl_file.put(DownloadFile, 'aaaa' );
utl_file.fclose(DownloadFile);
END;

The result will be a one line with a line break at the end.

Is there a way to prevent the trailing line break? It's quite important as we want to use the resulting file as an input file for another application which can not cope with this trailing newline.

Best regards,
Moschen
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 13 2007
Added on Jul 16 2007
4 comments
900 views