Python Forum

Full Version: How to Save Full Email Body to CLOB in Oracle w/Carriage Returns?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've been working on code that successfully saves an entire email body content to a CLOB field in Oracle.

For the life of me, I cannot get the carriage returns that are present in the Oracle email to come across / save into the CLOB field in the Oracle database. All of the carriage returns and/or line breaks in the email that of course make it very easily-readable don't end up carrying over into the Oracle field and the resulting content of that field is all strung together and very difficult to quickly glance at/read.

I've attached a sample of the code as a text file. The code in this block basically cycles through the email body line by line and builds a new string. I've tried adjusting the code in the attached text file to include chr(10) and/or chr(13) for line breaks / carriage returns, but the resulting data that's inserted into Oracle later on in some additional code still is all run together with the line breaks / carriage returns not present.

Thanks in advance for any ideas here!