SET FEEDBACK OFF
SET HEADING OFF
SET ECHO OFF
SET VERIFY OFF
SET PAGESIZE 0
SET TERMOUT OFF
whenever sqlerror exit 9
SELECT EMPNO into v
WHERE DENO = 999 ;
--- unix file
sqlplus scott/tiger@orcl @inpfile.sql
if [ $? -eq 0 ]
echo "last command exit status needs to be checked"
echo "last command exit status is successful"
When I run the Unix shell script then it stopped in sqlplus .
In sql query there is no data present and I do not handle it in exception block.
So I am going to capture the error through whenever sqlerror exit 9.
It does not return the message "last command exit status needs to be checked".
When unix shell script executed then the cursor stops on sqlplus.
What is wrong with the code ?