If I have a shell script log into oracle and then select sysdate from dual. How would I pass that information into a variable inside my shell script?
Printable View
If I have a shell script log into oracle and then select sysdate from dual. How would I pass that information into a variable inside my shell script?
Code:TO_DT=`sqlplus -s $CONNECT <set feedback off
set pages 0
set echo off
select nvl(to_char(sysdate,'yyyymmdd')) From dual;
exit
EOF
`
echo TO_DT is: $TO_DT
It works great thanks.