Sending messages [message #301642] |
Thu, 21 February 2008 03:54 |
user71408
Messages: 585 Registered: November 2007 Location: NE
|
Senior Member |
|
|
Hi I have records as follows.
Number Rows stmt
------------------------------
1001 10 select count(*) from tabs where rows<=10
now what happens is if rows<=10 it returns '0' .if it's >10 then it returns 'nothing'
Now the requirement is :
" if rows>10 i need to send a mail to any(for example... abc.ss@gmail.com mail-id mentioned as " The statement was failed because rows>10."
I need to write "SHELL SCRIPT" for this.
So anyone please send me the script for this issue..
Thank you.
[Updated on: Thu, 21 February 2008 04:00] Report message to a moderator
|
|
|
|
Re: Sending messages [message #301660 is a reply to message #301657] |
Thu, 21 February 2008 04:52 |
user71408
Messages: 585 Registered: November 2007 Location: NE
|
Senior Member |
|
|
i wrote a query in the script as follows
[code]
EXEC SQL DECLARE num_rows CURSOR FOR
SELECT rowidtochar(t.rowid) t_rowid
,t.nums
,t.rows
,atc.sql_statement
FROM check t
WHERE t.nums = :ps_nums
ORDER BY t.rows;
|
|
|
|
Re: Sending messages [message #301665 is a reply to message #301662] |
Thu, 21 February 2008 05:08 |
user71408
Messages: 585 Registered: November 2007 Location: NE
|
Senior Member |
|
|
Here the problem is if we r entering number of rows . So there r 10 rows. but we enter "11" then it send mail to any mail-id "it was failed because it has value>0".
if we enter <=10 then no need to send any message.
This is the requirement "Michael".So could u please send me the solution for this issue...
" I wrote like this"
[code]
echo "message" | mail -s "subject" mail_id
[/code>
but i need to check whether it is exceeding the limit or not.
for that purpost i need to take a variable and check it.
|
|
|
|
Re: Sending messages [message #301688 is a reply to message #301667] |
Thu, 21 February 2008 06:33 |
user71408
Messages: 585 Registered: November 2007 Location: NE
|
Senior Member |
|
|
hi Michel,
I have two variables A,B
A:=0 and B<>0
now the requirement is
if A then
display message as " working fine"
else
(i.e if B then)
dispaly message as " you are crossing the limit".
I need to write to write a program for this using "shell scripting".
so could u please send me the solution for this.
[note: These mesages should be sent to mail-id's]
Thank you.
[Updated on: Thu, 21 February 2008 06:34] Report message to a moderator
|
|
|
|
|