SQL*Plus (MOSC)

MOSC Banner

How to stop the execution of a SQL program after running a batch file with host command which failed

edited Jan 23, 2012 5:16AM in SQL*Plus (MOSC) 6 commentsAnswered ✓
Hello,

I have a SQL program (not PL/SQL) executed from Oracle Concurrent Manager. In the middle of my SQL program, I runs a Unix Shell script with Host command.

What I want is: if the shell script returns an error, the request from Oracle Concurrent Manager will be terminated with an Error Status and the SQL program will be stopped.

In the below example: All the 'B' statements will not be executed if MyShellScript.sh fails.

Here is  my SQL program:

statement_A1;

statement_A2;

host MyShellScript.sh

statemment_B1;

statement_B2;

exit;

Your help will be very appreciated. Thanks in advance.

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center