I am trying to store the SQL query below in a variable within a shell script.
sqlplus -s 'username/password@"(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=hostname.com)(PORT=portnumber)))(CONNECT_DATA=(SERVICE_NAME=Servicename)))"' <<EOF
SPOOL /tmp/out.txt
select count(scheduletaskid)from devicetask where status=6 group by coreid;
SPOOL OFF
exit;
EOF