Thanks Jay and ramesh for wuick response.
Do i need to
spool the data for mailing at the end? If so how can i do that?
I am new to unix..so please dont mind.
---------- Post updated at 06:43 AM ---------- Previous update was at 06:34 AM ----------
I am trying like this. Could you please check if this is fine?
Code:
#!/bin/ksh
sqlplus -s $prodUser/$prodPasswd@$prodDatabase <<SQL
spool $LOG
select 'student name,subject,marks' from dual;
set serveroutput on size 1000000;
SELECT
student name,subject,markst(*) count1
FROM
student
WHERE
student_name='$line'
if student_name is null then
null;
else
dbms_output.put_line(student_name||','||subject||','||marks);
end if;
end;
/
!
done
spool off
SQL
mailx -s "$message" rdhanek@yahoo.com