How do i send email from my pl/sql program using utl_smtp
589737Oct 17 2007 — edited Oct 26 2007I have written the following procedure as to use as a monitoring check. How do i incorporate utl_smtp to send me v_output if the result is '0'. I have the syntax for utl_smpt, just not sure how to integrate it with this procedure. Please help.
create or replace PROCEDURE sp_data_check(p_date number) is
--DECLARE
v_table_name varchar2(35);
v_string varchar2(1024);
v_result number;
v_output varchar2(1024);
CURSOR c_table is
select table_name
from user_tab_columns
where COLUMN_NAME = 'REPORT_DATE'
and table_name NOT LIKE '%BIN%';
BEGIN
OPEN c_table;
loop
FETCH c_table into v_table_name;
exit when c_table%NOTFOUND;
v_string:='select max(decode(report_date,'||p_date||',1,0))'|| ' from ' || v_table_name;
execute immediate v_string into v_result;
v_output:=v_table_name||':'||v_result;
dbms_output.put_line(v_output);
end loop;
close c_table;
END;
Message was edited by:
rubes7202