I have below procedure which sends email for every KPI_NAME exist in the TRACK_KPI table
create or replace procedure execute_send_mail_smtp as
begin
FOR KPI_TRACK_ROW IN (Select KPI_NAME FROM RATOR_MONITORING.TRACK_KPI)
LOOP
SEND_MAIL_SMTP(
'support@leo.com', --Sender
'r.d@leo.com', --Recipient
'TEST- KPI NOT RUNNING', --Subject
'Below KPIs are not running:' || KPI_TRACK_ROW.KPI_NAME --Message
);
END LOOP;
end execute_send_mail_smtp;
This log is incorrect. I want to send in only one email all the KPI_NAME from TRACK_KPI table. The records should be formatted and for every records there should be new line in email. Also i want to check if there is no recors exist then it sends an email as 'the KPI does not exist'. I really wondered if i can do this in my procedure. I also want to send email to more than one recipient then is it possible to provide more than one recipient?