#!/bin/ksh
#[[ -f ./.profile ]] && . ./.profile 2>/dev/null
if test -f '.profile'; then . ./.profile; fi;
#. .profile
LOG_DIR=/app/rpx/jobs/scripts/just/logs
sendEmail()
{
pzCType="$1"; pzTitle="$2"; pzMsg="$3"; pzFrom="$4"; pzTo="$5"; pzFiles="$6"; pzReplyTo="$7"
(
echo "From: $pzFrom\nTo: $pzTo\nSubject: $pzTitle${pzReplyTo:+\nReply-To: $pzReplyTo}"
[[ -n "$pzCType" ]] && echo "Content-Type: $pzCType"
echo
echo "$pzMsg"
[[ -n "$pzFiles" ]] &&
echo &&
for pzFile in $pzFiles
do
[[ -f "$pzFile" ]] && uuencode "$pzFile" "$pzFile"
done
) | mail "$pzTo"
}
## all pending subscriber .
`pending=sqlplus -s pag_app/abcdef@prpx1-vip.unix.gsm=1900.org:7779/prpx.unix.gsm1900.org <<EOF
set pagesize 0;
SET LINESIZE 180;
SET MARKUP HTML ON SPOOL ON PREFORMAT OFF ENTMAP ON -
HEAD "<TITLE>Pending</TITLE> -
<STYLE types='text/css'> -
<!-- BODY {background: #FFFFC6}--> -
</STYLE>" -
BODY "TEXT='#FF00Ff'" -
TABLE "WIDTH='90%' BORDER='5'"
SPOOL report.html
select msisdn,status_changed_time,rate_plan_id,status from subscriber where status = 'P' and status_changed_time < sysdate order b
y status_changed_time desc;
SPOOL OFF
EOF`
activating=`sqlplus -s pag_app/abcdef@prpx1-vip.unix.gsm1900.org:7779/prpx.unix.gsm1900.org <<EOF
set feedback off;
set heading off;
set trimspool on;
set pagesize 0;
SET LINESIZE 180;
select msisdn,status_changed_time,rate_plan_id,status from subscriber where status = 'I' and status_changed_time < sysdate order b
y status_changed_time desc;
EOF`
final="Pending
$pending
Activating
$activating"
sendEmail '' "Pending_Activating" "$final" 'ankit.gupta92@gmail.com' 'ankit.gupta92@gmail.com' " " ' '
echo $final > $LOG_DIR/pending_`date +%d%m%y`.log
I tried this but its giving no output, can you please brief the steps in sequence that i need to follow, to get the desired output in table and attractive background
Moderator's Comments:
Please use QUOTE tags to display data that you are quoting from an earlier post; not to indicate your new comments in the current post.
Last edited by Don Cragun; 02-14-2015 at 12:54 AM..
Reason: Remove unneeded QUOTE tags.
Everybody,
can you tell me how express about this; we have text data file as :
parameter1 Parameter2
AA 55
BB 77
. .
. .
. .
We want to draw table for this data as attached then send as body of Email (4 Replies)
Hi
The below script working when we are sending the html as attachment can u please guide how to send thesmae data in table form direct in the mail and not in mail attachment .
cat Employee.sql
SET VERIFY OFF
SET PAGESIZE 200
SET MARKUP HTML ON SPOOL ON PREFORMAT OFF ENTMAP ON -
HEAD... (0 Replies)
I have to send a couple of rows that have been returned from a SQL query. I have written the output of the query to a file and while i try to print this in the mail body the formatting goes wrong.
Intended Output in mail body:
Col1 Col2 Col3
------ ... (2 Replies)
Hello,
Currently i have a script which will disply the results in plain text format.
I want to format the result in more readable format like Making bold headings and format with colors etc. Something like html and send that content as email.
Please help me how i can do that.
I am using... (10 Replies)
I have written a shell script that calls below sql file. It is not sending the query data in table in the body of email.
spool table_update.html;
SELECT * FROM PROCESS_LOG_STATS where process = 'ActivateSubscription';
spool off;
exit;
Please use code tags next time for your code and data.... (9 Replies)
Hi
I am trying to run sql query from solaris in csh script and send the output to email. Below is my sql query
select p.spid,se.program seprogram, se.machine, se.username, sq.sql_text,sq.retrows from v$process p
inner join v$session se on p.addr = se.paddr
inner join
( select... (2 Replies)
I have two details to send in html email, two details present in variables, Processname & date which I need to send html email in table. Column1 is Processname: Process1 & column 2 is date:16/6/16 4:55 AM
I have below basic html code, how to create table in html to send mail
echo "<html>" >>... (1 Reply)
Hello,
In my shell script, I extract table data from HP Vertica DB into a csv file using vsql -c command. But the problem is the file getting created is in binary format and hence some of the data becomes unreadable which has chinese characters as part of data.
file -i filename.csv - gives... (2 Replies)
Discussion started by: Dharmatheja
2 Replies
LEARN ABOUT DEBIAN
isql
isql(1) UnixODBC Reference isql(1)NAME
isql - utility to submit SQL queries to a data source.
iusql - Unicode version of isql.
SYNOPSIS
isql DSN [UID [PWD]] [options]
DESCRIPTION
isql can be used to submit SQL to a data source and to format/output results. It can be used in batch or interactive mode.
OPTIONS
DSN Name of the data source you want to connect to.
UID Your login to connect the DSN.
PWD Your password needed to login to the DSN.
-b Batch mode. It will not do any prompting.
-dx Delimit columns with x.
-x0xXX Delimit columns with XX, where XX is in hex. For example -x0x09 will use a tab.
-w Wrap results in an HTML table
-c Print column names on first row. This options only has effect in combination with the -d option.
-mn Limit column display width to n
-v Verbose output.
--version
This prints the version.
EXAMPLES
cat My.sql | isql WebDB MyID MyPWD -w
Each line in My.sql must contain exactly 1 SQL command except for the last line which must be blank.
AUTHOR
This manual page was written by Kurt Roeckx <kurt@roeckx.be> for the Debian package of unixODBC.
UnixODBC Dec 2004 isql(1)