Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Trapping Errors in SQL*Plus
I know you don't want to use PL/SQL, but if you want to trap
the reason of the failure you can enclose each statement in
an anonymous PL/SQL block:
whenever sqlerror exit [rollback|commit];
begin
<your first statement>
exception
when others then
<what you want, for instance dbms_output.put_line(sqlerrm);> raise;
--
Regards
Michel
Mark Sims <mark.k.sims_at_bt.com> a écrit dans le message :
3826D792.E0A794CF_at_bt.com...
> Many thanks for the suggestion. Whilst this works in the sense of stopping
> the process it doesn't allow us to trap the reason for the failure (and hence
> stop gracefully).
>
> Regards,
>
> Mark Sims
>
> Michel Cadot wrote:
>
> > Even in SQL*Plus you can use the statement
> > whenever sqlerror exit [commit|rollback];
> >
> > This makes the script exit SQL*Plus when an error occurs.
> >
> >
> >
>
Received on Mon Nov 08 1999 - 08:34:10 CST