sql output generates on a os text file !
Dear Friends ,
In unix platform I want to create a script which helps to keep the sql command output in a os text file . Hence , I have to try in the following way :
vi aud.sh
Date=`date +%d%b%Y`.`date +%I`.`date +%M%p`
sqlplus /nolog
conn audita/audita@onlinete << !
spool file.$Date.txt
select * from scott.dept;
exit;
Output :
---------
bash-3.00$ sh aud.sh
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Jan 14 17:40:31 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL>
--------
Now the problem is , it makes just connected with oracle but next two lines are not executed . If it is executed then output stores on "file.$Date.txt" file .
Now can anybody plz help me how can I execute last three(3) lines of my script ?
waiting for ur kind reply ... ...
|