11-11-2010
163,
0
Join Date: Oct 2007
Last Activity: 27 March 2012, 6:20 AM EDT
Posts: 163
Thanks Given: 4
Thanked 0 Times in 0 Posts
Hi,
I just firt tried this way. But it giving errors
#! /bin/ksh
su - oracle
count=$( sqlplus -s abc/abc@mydb @select count(*) from xyz.order where create_date < sysdate - 1/720; )
But output has error Syntax error: `(' is not expected.
how to fix?
Meanwhile in IF THEN statement I want to append output count in simple txt file. How to add?
if [ $count -gt 20 ]
then
# Coutput will be in txt file. And will append the output in same file
fi
---------- Post updated at 04:30 PM ---------- Previous update was at 03:16 PM ----------
Hi guys,
i do able to connect to oracle. Infact, i need to export env variable.
[I]#! /bin/ksh
export ORACLE_HOME=/opt/oracle/app/oracle/product/9.2
/opt/oracle/app/oracle/product/9.2/bin/sqlplus -s abc/abc@mydb @myquery.sql
exit
But exit is not working here. I need to put manually exit command. What to do?
---------- Post updated at 04:47 PM ---------- Previous update was at 04:30 PM ----------
Sorry guys for too many message. i will write my query in other message. Ignore this THREAD. Moderator also can delete it.