Take Data From a table and send it through mail | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

Take Data From a table and send it through mail

Shell Programming and Scripting


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 03-09-2013
ginrkf ginrkf is offline
Registered User
 
Join Date: Mar 2013
Last Activity: 8 July 2014, 5:21 AM EDT
Posts: 35
Thanks: 3
Thanked 0 Times in 0 Posts
Take Data From a table and send it through mail

Hi can anyone help me in writing a code for taking data from a table and need to send that data through mail using mail -x command..
Sponsored Links
    #2  
Old 03-09-2013
panyam panyam is offline Forum Advisor  
Registered User
 
Join Date: Sep 2008
Last Activity: 24 July 2014, 3:48 AM EDT
Posts: 1,156
Thanks: 20
Thanked 104 Times in 99 Posts
Table you mean from Data Base ? If so , is it from which DB?

I am assuming that the table exists in Oracle, you can do:

(1) Connect to oracle DB, using sqlplus -s "user_name/passwd"@oracle_sid <<
write your query here to get the data
(2) store the step(1) output into a file
(3) mail the file using mail -x from the file obtained in step 2)

Regards,
Sponsored Links
    #3  
Old 03-09-2013
ginrkf ginrkf is offline
Registered User
 
Join Date: Mar 2013
Last Activity: 8 July 2014, 5:21 AM EDT
Posts: 35
Thanks: 3
Thanked 0 Times in 0 Posts
Thanks

How to store the output into a file .I am using oracle DB

I need to select 9 columns

---------- Post updated at 08:07 AM ---------- Previous update was at 06:22 AM ----------

Thanks

How to store the output into a file .I am using oracle DB

I need to select 9 columns
    #4  
Old 03-09-2013
Yoda's Avatar
Yoda Yoda is offline Forum Advisor  
Jedi Master
 
Join Date: Jan 2012
Last Activity: 22 September 2014, 5:48 PM EDT
Location: Galactic Empire
Posts: 3,384
Thanks: 234
Thanked 1,208 Times in 1,134 Posts
SQL*Plus command SPOOL can be used to store query result in file.

Syntax:

Code:
SPOOL filename
--your query here
SPOOL OFF

Note: Search the internet and you will find many examples of spooling along with how to format query results.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Represent the data in table format as in mail content navsan Shell Programming and Scripting 8 03-15-2013 04:38 PM
Mailx command - send mail as table format qwertyu Shell Programming and Scripting 2 11-29-2012 11:37 AM
Send mail through shell script with HTML table. Kinshuk Saxena Shell Programming and Scripting 2 09-15-2012 02:51 PM
How to send html file in a mail not as an attachment but it should display in the mail in table for mani_isha UNIX for Dummies Questions & Answers 0 03-30-2010 03:37 AM
Arrange Data in table and send by mail xjklop2009 Shell Programming and Scripting 4 11-28-2009 01:50 PM



All times are GMT -4. The time now is 08:19 AM.