I am trying to execute a script which actually runs a SQL and returns the value , write to to a CSV file and send it.
/data/oracle/product/10.2.0.4/bin/sqlplus -s user_name/[email protected] @/export/home/script/abc.sql
I want to capture the error whenever there is any error while running the SQL part but it always hangs.
I tried putting "(($?)) && ((ERRORS += 1))" after above statement but it never reaches to that line.
I want to capture the error code in a variable ERROR and exit with the error code.
you can put it under TRY-Catch block. refer this manual