How to store SQL output in a variable
I am writing a script which has the following SQL query:-
echo -e "select count(*) from aetbs_process_progress where status !='S'and PROCESS!='MarkEoti' and STARTTIME='$DATE1'" >> $PGM1
I am running this query as follows in the later part of script.
sqlplus $ORACLE_USER/$ORACLE_PASSWORD @$PGM1
How can I store the output of @$PGM1 in a variable and match it in the if condition?