Lets say there are three process, a.sh, b.sh, and c.sh. Now if I have to run c.sh iff a.sh gets over without any error/exception. what would be the code for that.
Suppose our shell script is run after running a sql script in ORACLE. Is there any way in unix shell script which first runs sql query & then run the script. ( that too if no error/exeception is incurred in sql script ). IP userid & pasword of the database is known.
Answer of 2nd point is yes you can do that in shell script...have a look at code below..from this script you can check if err_message have some value in it then there is a oracle error.And if there is no value in that variable you can run the script....that can be done by IF THEN ELSE.......
Z=`sqlplus -s user/password@host <<eof
set serveroutput on;
declare
v_message varchar2(1000);
v_value number;
begin
select column into v_value from tablename where rownum<2;
EXCEPTION
WHEN OTHERS THEN
v_message := SQLERRM;
dbms_output.put_line(v_message);
END;
/
EXIT;
eof`
err_message=`echo "$Z" | grep "ORA-"`
echo $err_message