December 2010
Intermediate to advanced
451 pages
11h 16m
English
You have a scheduled job that runs a stored procedure at a regular interval. The procedure produces output that ordinarily would be sent to the screen via the DBMS_OUTPUT.PUT_LINE procedure, but since it runs as a nightly batch job, you want to send the output to a distribution list as an e-mail message.
Save the output in a CLOB variable and then send it to the target distribution list using the UTL_MAIL.SEND procedure. For example, suppose you want to audit the employee table periodically to find all employees who have not been assigned to a department within the company. Here's a procedure to do that:
CREATE OR REPLACE PROCEDURE employee_audit AS
CURSOR driver IS -- find ...Read now
Unlock full access