Sponsored Content
Top Forums Shell Programming and Scripting Shell scripting unable to send the sql query data in table in body of email Post 302918925 by Sharanakumar on Friday 26th of September 2014 07:55:02 AM
Old 09-26-2014
Thanks Vbe for quick reply

I am using korn shell on an AIX machine..
shell script as below:
Code:
. /ptma/ptma.profile;
echo $DB_PASS | sqlplus $DB_USER@$DB_SID @/ptma/ActivationCountCheck/ActivationCountCheck.sql;
mail -s "Activation Count of Last Day" someone@something.com < table_update.html
exit;

while the sql file has:
Code:
spool table_update.html;
SELECT appid, sum(resp) 
FROM PROCESS_LOG_STATS 
where process = 'ActivateSubscription' and ddate > sysdate-2 group by process, appid ORDER BY process, appid;
spool off;

The mail is triggrred but body of mail has data in text format but not in proper report/excel/html format.

Moderator's Comments:
Mod Comment Please use code tags next time for your code and data. Thanks

Last edited by vbe; 09-26-2014 at 09:07 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Shell to run query, encrypt and send email

Hello To do : 'automate the process of generating report and send it to client every 15 days after encrypting the report file' Did so far : - generate Java program to encrypt the file. - generate SQL query to run the report. Is there any body who can help me to go further ? ... (7 Replies)
Discussion started by: cub
7 Replies

2. Shell Programming and Scripting

How to use sql data file in unix csv file as input to an sql query from shell

Hi , I used the below script to get the sql data into csv file using unix scripting. I m getting the output into an output file but the output file is not displayed in a separe columns . #!/bin/ksh export FILE_PATH=/maav/home/xyz/abc/ rm $FILE_PATH/sample.csv sqlplus -s... (2 Replies)
Discussion started by: Nareshp
2 Replies

3. Shell Programming and Scripting

We need a script that invokes the sql query every 14 days ans send email

Hi, We need a script that invokes the sql query every 14 days ans send email (0 Replies)
Discussion started by: bujjisveeru
0 Replies

4. Shell Programming and Scripting

We need a script that invokes the sql query every 14 days ans send email

HI, We need a script that invokes the sql query every 14 days ans send email (0 Replies)
Discussion started by: bujjisveeru
0 Replies

5. Shell Programming and Scripting

How to get full sql table data using shell script

i have a Oracle table like col1 col2 ---- ----- a 1 b 2 c 3 when i write a script for it , it gives me all the data in one column. Please give me the solution which gives the exact result like we see in sql editors. for a in `echo " set feedback off; set pagesize 40;... (1 Reply)
Discussion started by: ss135r
1 Replies

6. Shell Programming and Scripting

SQL query output convert to HTML & send as email body

Hi , I have a sql query in the unix script ,whose output is shown below.I want to convert this output to HTML table format & send email from unix with this table as email body. p_id src_system amount 1 A 100 2 B 200 3 C ... (3 Replies)
Discussion started by: jagadeeshn04
3 Replies

7. Shell Programming and Scripting

HTML table in email body using C Shell

I am using Sun Solaris ver. 5.10 and trying to send an HTML table in email body using mail command in C shell script. I tried following commands:- #1 mail -m "MIME-Version: 1.0;Content-type:text/html;charset=UTF-8" receiver@mail.com < file.html #2 mail -m "Content-type: text/html;" -s "This... (4 Replies)
Discussion started by: jnrohit2k
4 Replies

8. Shell Programming and Scripting

Regarding guidance related to HTML table in email body

Hello All, I have a query here. I am sending an HTML table(which I am creating it by a call to REST API, in a LINUX box) and from there I have to send it into an email. So following are the poins on same: As data is not static so it is writing Dynamic data and creating HTML file. There is... (9 Replies)
Discussion started by: RavinderSingh13
9 Replies

9. UNIX for Beginners Questions & Answers

Not able to generate table in email body

Below is the code snippet and I'm not able to generate the table in email, output email has nothing if ; then echo "File $fName exists." awk -F "," ' BEGIN { print "MIME-Version: 1.0" print "Content-Type: text/html" print "Subject: Out OF Network Fee - Portfolio Level Stats" print... (1 Reply)
Discussion started by: vyomdev
1 Replies

10. UNIX for Beginners Questions & Answers

Shell Script to read hive table and send email

HI Team, I am working on reading hive table and send email in email body using shell script, can you please help on fixing the errors: I have 6 columns in my hive table and trying to send the email in the mail body. below script: #!/bin/bash hive -e 'SELECT count(*) from db.table' >... (4 Replies)
Discussion started by: Mi4304
4 Replies
rsm_get_segmentid_range(3RSM)			      Remote Shared Memory Library Functions			     rsm_get_segmentid_range(3RSM)

NAME
rsm_get_segmentid_range - get segment ID range SYNOPSIS
cc [ flag... ] file... -lrsm [ library... ] #include <rsmapi.h> int rsm_get_segmentid_range(const char *appid, rsm_memseg_id_t *baseid, uint32_t *length); DESCRIPTION
RSM segment IDs can be either specified by the application or generated by the system using the rsm_memseg_export_publish(3RSM) function. Applications that specify segment IDs require a reserved range of segment IDs that they can use. This can be achieved by using rsm_get_seg- mentid_range() and by reserving a range of segment IDs in the segment ID configuration file, /etc/rsm/rsm.segmentid. The rsm_get_segmen- tid_range() function can be used by applications to obtain the segment ID range reserved for them. The appid argument is a null-terminated string that identifies the application. The baseid argument points to the location where the starting segment ID of the reserved range is returned. The length argument points to the location where the number of reserved segment IDs is returned. The application can use any value starting at baseid and less than baseid+length. The application should use an offset within the range of reserved segment IDs to obtain a segment ID such that if the baseid or length is modified, it will still be within its reserved range. It is the responsibility of the system administrator to make sure that the segment ID ranges are properly administered (such that they are non-overlapping, the file on various nodes of the cluster have identical entries, and so forth.) Entries in the /etc/rsm/rsm.segmentid file are of the form: #keyword appid baseid length reserved SUNWfoo 0x600000 1000 The fields in the file are separated by tabs or blanks. The first string is a keyword "reserve", followed by the application identifier (a string without spaces), the baseid (the starting segment ID of the reserved range in hexadecimal), and the length (the number of segmentids reserved). Comment lines contain a "#" in the first column. The file should not contain blank or empty lines. Segment IDs reserved for the system are defined in the </usr/include/rsm/rsm_common.h> header and cannot be used by the applications. RETURN VALUES
Upon successful completion, these functions return 0. Otherwise, an error value is returned to indicate the error. ERRORS
The rsm_get_segmentid_range() function can return the following errors: RSMERR_BAD_ADDR The address passed is invalid. RSMERR_BAD_APPID The appid is not defined in configuration file. RSMERR_BAD_CONF The configuration file is not present or not readable, or the configuration file format is incorrect. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Unstable | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
rsm_memseg_export_publish(3RSM), attributes(5) SunOS 5.10 8 May 2003 rsm_get_segmentid_range(3RSM)
All times are GMT -4. The time now is 03:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy