Hi
STORAGE_TYPE=$1
echo "########### SQL SESSION STARTED ###########"
VALUE=`sqlplus -S /nolog << THEEND
connect tcupro/tcupro_dev@bdd1optn
SET SERVEROUTPUT ON
DECLARE
V_STORAGE_TYPE varchar2(3);
V_ERR_MSG varchar2(255) ;
V_LOG_LEVEL varchar2(200);
BEGIN
V_STORAGE_TYPE := '$STORAGE_TYPE';
V_ERR_MSG := 'SUCCESS';
V_LOG_LEVEL := 'DETAIL';
dbms_output.put_line(V_STORAGE_TYPE);
TCUPRO.TCU_PURGE_TABLES_DUP(V_STORAGE_TYPE, V_ERR_MSG,V_LOG_LEVEL);
dbms_output.put_line(V_ERR_MSG);
END;
/
EXIT;
THEEND`
echo $VALUE >./logs/TCU-`date '+%Y%m%d-%H%M%S'`-PURGE.log
Actuall this $value will have ' Success,Pl/sql procedure completed successfully.'
So I want to check that variable $value has success word or not.
and on the basis of that want to return exit code.