Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Newline in raise_application_error()
sonyantony_at_hotmail.com wrote:
> I need to display an error message that has multiple lines, from a
> trigger
> raise_application_error( -20004, 'ERROR MSG LINE1 \n ERROR MSG LINE2' )
> ;
>
> But the code above prints
> ERROR MSG LINE1 \n ERROR MSG LINE2
>
> instead of
> 'ERROR MSG LINE1
> ERROR MSG LINE2'
>
> Is there any way of doing it ?
> Thanks
> --sony
PL/SQL doesn't understand C escapes. The obvious solution is this:
raise_application_error(-20004,'Line 1
Line 2');
(note the line break - you don't need to escape it.) Alternatively:
raise_application_error(-20004,'Line 1'||chr(13)||chr(10)||'Line 2');
Hth,
Vladimir M. Zakharychev
N-Networks, makers of Dynamic PSP(tm)
http://www.dynamicpsp.com
Received on Thu Dec 07 2006 - 12:46:10 CST