Oracle add new line character to varchar variable for utlmail message

1.3k Views Asked by At

I am creating the body of an email for utlmail and I want to create a string and replace tokens in the string. The first problem I am having is displaying new lines in the body of the email.

Mesg VARCHAR2(4000) := q'[Item1:token1 /n/n Item2:token2]'; 

When I replace the tokens and send the message via utlmail, /n/n displays in the email message instead of creating a new line.

I also want to have roughly 20 items listed in the message, how do I initialize a variable with a large initial text(ie, initialize it on multi lines and not 1 long line).

Thanks for any help

1

There are 1 best solutions below

0
On

Figured it out

Mesg VARCHAR2(4000) := q'[item1:token1]' 
|| utl_tcp.CRLF || q'[item2:token2]';