Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Abort script in SQLPLUS
klabu wrote:
> 10gR2
>
> How to quit a script in SQL*PLUS ?
>
> I have this line:
>
> ACCEPT v_inp PROMPT 'Quit (Q) or Run(R) ?'
>
> I want the script-running aborted if v_input is Q
>
> thanks
One way is to use sql*plus "whenever sqlerror exit" and pl/sql raise_application_error such as:
whenever sqlerror exit
begin
if &v_input. = 'Q' then raise_application_error( -20000, 'Quit');
endif;
end;
/
whenever sqlerror continue Received on Sat Oct 14 2006 - 18:49:24 CDT