hey i have to connect to sql through shell script , then store the value of the query in a variable and then compare it after some time after running a process.
i have used this code but it is not working.
#!/bin/sh
Val = (sqlplus -s rte/rted2@rel76d2 <<!
SELECT MAX(STAT_ID) FROM CVT_STATS;
!)
echo $Val
nohup ./cvt -f MediationSources.xml &
sleep 60
Val1 = (sqlplus -s rte/rted2@rel76d2 << !
SELECT MAX(STAT_ID) FROM CVT_STATS;
!)
if[$Val ==$Val1]; then
echo FAIL
else
echo PASS
fi