I'm trying to monitor queues for specific tickets and email the user only when a new ticket is created.
But to complicate things, I need to think how I'm going to deal with repeat emails on the same ticket until it is closed.
Meaning, script runs every 15 minutes, if it finds a ticket and report on it, then the next 15 minutes it will report the same ticket and I don't want that.
The script itself is functioning , as in ... sqlplus query finds tickets and the script emails them however, it emails all the tickets and only want to see the ticket that was create in the last 15 mins.
really confused ... or I'm going about this wrong way .....
Change your query so the 'cct' and 'qid' selection is done as one condition so if that condition is meet and then the date condition is meet, the data is selected:
Your current query is only looking at date selection for the 'or' cct selection:
Your query does make more sense ...thank you very much, however the results are still same as in that the script emails all of the tickets and not just the newest one ...
I'm wondering if I have cat the log file to see if the was previously listed and if not then email if yes then send no email ...
Better to add a flag column to database to identify which all have not been sent. While you send the emails, store the primary key in some temp file. Then after sending mails, update the flag column of database using that temp file.
While retrieving data from table check the condition on flag column.
As donadarsh said you could add a column(sent) to your table and just update it to a 'Y' or '1' when row has been sent.
You would then change your sql to only select rows that have not been sent: select ticket_number, qid, to_char( rcd, 'dd-mon-yyyy hh24:mi:ss' ) as rcd, to_char( ap_date, 'dd-mon-yyyy hh24:mi:ss' ) as ap_date, cct, customer from vt_tr where sent != 'Y' -- Or a '1' if you deceide to use 0 and 1 order by rcd;
Hi,,
I have requirement that i need to get DISTINCT values from a table and if there are two records i need to update it to one record and then need to submit INSERT statements by using the updated value as a parameter. Here is the example follows..
SELECT DISTINCT ID FROM OFFER_GROUP WHERE... (1 Reply)
Hi! all
can any one tell me how to compare current record of column with next and previous record in awk without using array
my case is like this
input.txt
0 32
1 26
2 27
3 34
4 26
5 25
6 24
9 23
0 32
1 28
2 15
3 26
4 24 (7 Replies)
Hi,
I have a input file with the following entries:
1one
2two
3three
1four
2five
3six
1seven
1eight
1nine
2ten
2eleven
2twelve
1thirteen
2fourteen
The output should be: (5 Replies)
Hi,
I have a input file with the following entries:
1one
2two
3three
1four
2five
3six
1seven
1eight
1nine
2ten
The output should be
1one
2two
3three
1four
2five
3six (2 Replies)
Hi,
I have a large file with huge number of records which are of following pattern:
TYPE1
{
originNodeType : "IVR"
originHostName : "AAIVR"
originTransactionID : "01310559"
originTimeStamp : "20110620192440+0530"
hostName : "hhhh"
voucher : '0'D
rProfileID : "ZZZZ"
Before
{
Flags :... (1 Reply)
Hello ,
I am trying to write a unix shell script to compare folder permission to say drwxr-x-wx and then send an email to my id in case the folders don't have the drwxr-x-wx permissions set for them .
I have been trying to come up with a script for few days now , pls help me:( (2 Replies)
Hi guys,
i have a big file with the following format.This includes header(H),detail(D) and trailer(T) information in the file.My problem is i have to search for the character "6h" at 14 th and 15 th position in all the records .if it is there i have to write all those records into a... (1 Reply)
I need to write a script that can find a bad record (for example: there is date field colom but value provided in the file for this field is N/A) then script shoud searches this pattern and then insert the whole record into the bad file.
Example:
File1
Name designation dateOfJoining... (2 Replies)
I need to write a script that can find a bad record (for example: there is date field colom but value provided in the file for this field is N/A) then script shoud searches this pattern and then insert the whole record into the bad file.
Example:
File1
Name designation dateOfJoining... (1 Reply)