Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Newline in raise_application_error()

Re: Newline in raise_application_error()

From: Vladimir M. Zakharychev <vladimir.zakharychev_at_gmail.com>
Date: 7 Dec 2006 10:46:10 -0800
Message-ID: <1165517169.661706.224520@n67g2000cwd.googlegroups.com>

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US