I am trying to write shell script that will pull output from sql db and store it in file in UNIX.
script:-
#echo $conn
sqlplus -l $conn << EOF
select name from employee where id = $1;
/
exit
EOF
i want to run the script in a way that i will pass id as parameter as well as output shoudl be stored in a file whic will also be passed as parameter.
Like below
if i want name of employee with id = 1 and want to store the output in out.txt, i want to run it like below:-