Home » SQL & PL/SQL » SQL & PL/SQL » UTL_SMTP attached file ends with blank line
UTL_SMTP attached file ends with blank line [message #213350] Wed, 10 January 2007 07:08 Go to next message
tries
Messages: 3
Registered: January 2007
Junior Member
Hello,

We use here the UTL_SMTP utility (oracle 9) to send a email with a file attached to it like:
begin_attachment;
loop
write_text(t_conn, (t_RGL || t_crlf));
end loop;
write_text(t_conn, (t_FOOTER)); -- no crlf concat
end_attachment;
end_mail;

Just like the code example from Oracle at
http://www.oracle.com/technology/sample_code/tech/pl_sql/htdocs/maildemo_sql.txt
But in the attached file I got 2 blank lines and after the last detail line also a CR.
I have looked into the sample code and noticed one thing. In the end_attachment it did a "write_data(conn, utl_tcp.CRLF)". So, skipping this command line I got one blank line less.
But still I have now one blank line after my detail lines of which the last one also ends with a CR.

What's the cause and hopefully the solution to this?

Thanks in advance,

Peter

Re: UTL_SMTP attached file ends with blank line [message #213400 is a reply to message #213350] Wed, 10 January 2007 11:04 Go to previous messageGo to next message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
have you tried both chr(10) and chr(10)||chr(13) for t_crlf?
Re: UTL_SMTP attached file ends with blank line [message #213516 is a reply to message #213400] Thu, 11 January 2007 01:57 Go to previous message
tries
Messages: 3
Registered: January 2007
Junior Member
Just tried it.
No difference...
Still the same output with one empty line at the end.
The last detail line seems to get a LF by ending the attachment or ending the mail.

[Updated on: Thu, 11 January 2007 02:25]

Report message to a moderator

Previous Topic: Refresh Path error in Materialized view
Next Topic: URGENT - How to find the master table for a view
Goto Forum:
  


Current Time: Sat Dec 03 08:18:23 CST 2016

Total time taken to generate the page: 0.15599 seconds