Hi All,
I have created a batch file in windows server to execute the procedure using sqlplus commands.
Please find the script below
@sqlplus usr/pwd@rdcdev @e:\sample\script\test.sql
ECHO %ERRORLEVEL%
in test.sql file, i have the written the below code.
spool test.lst
BEGIN
test_email_notiff;
END;
/
spool off;
When the ran the batch file, the procedure did not get executed successfully.Please find the below error in lst file
BEGIN
*
ERROR at line 1:
ORA-01403: no data found
ORA-06512: at "TEST_EMAIL_NOTIFF", line 7
ORA-06512: at line 2
and it returns the error level as '0'
Error informtion...is
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
BEGIN
*
ERROR at line 1:
ORA-01403: no data found
ORA-06512: at "TEST_EMAIL_NOTIFF", line 7
ORA-06512: at line 2
SQL> Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
e:\sample\script>ECHO 0
0
Completed at 09/30/2016 05:14 AM
I want the batch file returns the code '1' whenever error occurs. Currently it is returning error level '0'
Please share your suggesstions.
Thanks,
Ramya