A Simple Select statement is executed from CURRENT a shell. The value returned by the select query is transferred back to the shell.
For example:
RESULT=`sqlplus -s apps/WELCOME123@DEVPR12 < <(printf "set pages 0 \n select SYSDATE from dual; \n")` 
echo "RESULT=${RESULT}"
Another Way to Execute sqlplus from unix shell
sqlplus -s /nolog << EOF 
connect apps/Welcome123 
select sysdate from dual; 
exit; 
EOF 
 
 

3 comments:
First You got a great blog. I will be interested in more similar topics. I see you got really very useful topics, I will be always checking your blog thanks.
Post a Comment