The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 07-01-2009
rdhanek rdhanek is offline
Registered User
  
 

Join Date: Jun 2009
Posts: 74
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