Tag: error

Redirection on unix

Redirecting stdout and stderr ls > file - redirect output to file ls 2> err - redirect error to file named err ls 2>&1 file - redirect error to where output is going to file named file ls 1>&2 file - redirect stdout to stderr to file named file ls > file 2> err - … Continue reading Redirection on unix

How to terminate and rollback a SQL script when running in SQL*Plus when an error is encountered?

Adding the following line before running a SQL Script will terminate the SQL script from running and rollback the change when an error is encountered. WHENEVER SQLERROR EXIT SQL.SQLCODE ROLLBACK; Example: SQL> select * FROM test; no rows selected SQL> WHENEVER SQLERROR EXIT SQL.SQLCODE ROLLBACK; SQL> insert into test values ( 1 ); 1 row … Continue reading How to terminate and rollback a SQL script when running in SQL*Plus when an error is encountered?