SQL Plus - WHENEVER SQLERROR

About

It performs the specified action (exits SQL*Plus by default) if a SQL command or PL/SQL block generates an error.

Syntax

WHENEVER SQLERROR 
     {
        EXIT [SUCCESS|FAILURE|WARNING|n|variable|:BindVariable][COMMIT|ROLLBACK] 
        | 
        CONTINUE [COMMIT|ROLLBACK|NONE]
     }

where:

Example

WHENEVER SQLERROR EXIT SQL.SQLCODE ROLLBACK

Powered by ComboStrap