Hi All,
I am using the following function to send execution details of the process-flow. This process-flow is having 20 mappings. This is working fine.
The cIient requirment is to pass email-IDs from a back-end table(sam_mail_notification) with columns(smtp, port, from_address and to_address), right now the function is working on static(constant) values, Can I get the modified function from you.
--initialize variables here
-- main body -
retval number := 0; --default
-
-
mailhost CONSTANT VARCHAR2(30) := 'EMAILSERVER';
-
-
crlf CONSTANT VARCHAR2(2):= CHR(13) || CHR(10);
-
-
pSender VARCHAR2(30) := 'abc@dub.ae';
-
-
pRecipient VARCHAR2(30) := 'abc@dub.ae';
-
-
pSubject VARCHAR2(100) := 'Process REsults for: '||to_char(sysdate,'dd/mm/yyyy');
-
-
mesg VARCHAR2(32767);
-
-
mail_conn utl_smtp.connection;
-
-
cursor getResults is
-
-
select AREA.OBJECT_NAME,
-
AREA.CREATED_ON,
-
AREA.UPDATED_ON,
-
aramr.ELAPSE_TIME,
-
NUMBER_RECORDS_SELECTED,
-
NUMBER_RECORDS_INSERTED,
-
NUMBER_RECORDS_UPDATED,
-
NUMBER_ERRORS,
-
AREA.RETURN_RESULT,
-
AREA.EXECUTION_AUDIT_STATUS,
-
MESSAGE_SEVERITY,
-
MESSAGE_TEXT
-
from
-
all_Rt_audit_executions area,
-
all_Rt_audit_map_runs aramr,
-
all_rt_audit_exec_messages err
-
where AREA.execution_audit_id = ARAMR.execution_audit_id(+) AND
-
AREA.execution_audit_id = err.execution_audit_id(+)
-
and
-
trunc(area.created_on) = trunc(sysdate)
-
AND AREA.OBJECT_NAME IS NOT NULL AND AREA.TASK_TYPE!='ProcessFlow'
-
AND area.top_level_execution_audit_id =(select max(top_level_execution_audit_id)from all_Rt_audit_executions
-
where execution_name = (select execution_name from all_Rt_audit_executions where task_type ='ProcessFlow' and top_level_execution_audit_id =
-
(select max(top_level_execution_audit_id) from all_Rt_audit_executions)));
-
-
BEGIN
-
-
mail_conn := utl_smtp.open_connection(mailhost, 25);
-
-
mesg := 'Date: ' ||TO_CHAR( SYSDATE, 'dd Mon yy hh24:mi:ss') || crlf ||
-
-
'From: <'|| pSender ||'>' || crlf ||
-
-
'Subject: '|| pSubject || crlf ||
-
-
'To: '||pRecipient || crlf || '' || crlf ||
-
-
'MAPNAME START_TIME END_TIME ELAPSED SELECTED INSERTED UPDATED ERRORS RESULT AUDIT_STSTUS SEVERITY MESSAGE_TEXT'||crlf ;
-
-
for rec in getResults
-
-
loop
-
-
mesg:=mesg || rpad(rec.OBJECT_NAME,30)||
-
-
rpad(to_char(rec.CREATED_ON, 'HH24:MI:SS DD-MON-YY'),20)||
-
-
rpad(to_char(rec.UPDATED_ON, 'HH24:MI:SS DD-MON-YY'),24)||
-
-
rpad(to_char(rec.ELAPSE_TIME),7)||
-
-
rpad(to_char(rec.NUMBER_RECORDS_SELECTED),8)||
-
-
rpad(to_char(rec.NUMBER_RECORDS_INSERTED),10)||
-
-
rpad(to_char(rec.NUMBER_RECORDS_UPDATED),10)||
-
-
rpad(to_char(rec.NUMBER_ERRORS),5)||
-
-
rpad(to_char(rec.RETURN_RESULT),8)||
-
-
rpad(to_char(rec.EXECUTION_AUDIT_STATUS),10)||
-
-
rpad(to_char(rec.MESSAGE_SEVERITY),10)||
-
-
rpad(to_char(rec.MESSAGE_TEXT),200)||crlf;
-
-
end loop;
-
-
utl_smtp.helo(mail_conn, mailhost);
-
-
utl_smtp.mail(mail_conn, pSender);
-
-
utl_smtp.rcpt(mail_conn, pRecipient);
-
-
utl_smtp.data(mail_conn, mesg);
-
-
utl_smtp.quit(mail_conn);
-
-
return retval;
-
-
EXCEPTION
-
-
WHEN OTHERS THEN
-
-
return 1;
-
END;
Regards,
2 1710
Yes, of course you can change your function to accept input parameters as you require. Why dont you try changeing your function by including variables and posting back in case if you face any error!!
Yes, of course you can change your function to accept input parameters as you require. Why dont you try changeing your function by including variables and posting back in case if you face any error!!
Hi Amit,
But the values should come from database table only.
Regards.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Oliver |
last post by:
I've been looking for information regarding this and all i can gather
is posters informing posties to use $< and $>. However, i can't seem
to find an example on how to apply that.
Information...
|
by: vishnu mahendra |
last post by:
cah you please tell me how to find the execution time of a program in c.
thank you in advance,
vishnu
|
by: Ravi J |
last post by:
I am trying to load Microsoft Word and create a document in ASP.NET (C#). But the call to application creation 'Word._Application app = new Word.ApplicationClass();' takes quit a bit of time, and...
|
by: Bassel Tabbara |
last post by:
I wrote the following code:
oApp = new Outlook.Application();
oApp = new Outlook.Application();
oNameSpace= oApp.GetNamespace("MAPI");
oNameSpace.Logon(null,null,true,true);
//gets defaultfolder...
|
by: NickName |
last post by:
Hi,
Say, you have two inter-dependent packages of pA and pB. With the
successful execution of pA you would proceed to execute pB. And since
they would perform some repeatitive tasks on regular...
|
by: roman |
last post by:
Hi,
I would like to have two actions for one event. But I want the second
action to trigger when the first one action completes. Is it possible
to do this in javascript? I'm using the onclick...
|
by: Kosmos |
last post by:
Alright so I've got this Outlook code written in VBA in Access. The first part, which works, records information about appointment times based on the required days before notification of certain...
|
by: steven.rojas |
last post by:
I have a chat application based on PHP and Flash, I know that is
necessary execute the socket server script from the console (#!/usr/
local/bin/php -q), but my problem is that I don't have SSH...
|
by: Ethender |
last post by:
I am using the following function to send execution details of the process-flow. This process-flow is having 20 mappings. This is working fine.
The cIient requirment is to pass email-IDs from a...
|
by: vsrprasad16 |
last post by:
Hi All,
I am implementing a notification form similar to outlook email notification.
my application call this notification form from a dll. this dll includes a form class and this dll has some...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |