Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to create Jobs in Apex?

srivatsan krishnan - oracleMay 18 2009 — edited May 19 2009
Hello All

I have a procedure like the following which will email the output with csv attachment. I'd like to create a job for this procedure so that this procedure runs every 3 hours a day. Is there any procedure in apex i need to use or should i have to use dbms_job to achieve this?

create or replace procedure daily_emails
as
l_id number;
l_document blob;
begin
l_document := APEX_UTIL.GET_PRINT_DOCUMENT (
p_application_id => :APP_ID,
p_report_query_name => 'empcsv',
p_report_layout_name => 'empcsvl',
p_report_layout_type => 'xsl-fo',
p_document_format => 'xls');

l_id := apex_mail.send(
p_to => 'recipient@oracle.com',
p_from => 'noreplies@oracle.com',
p_subj => 'CSV Output',
p_body => 'Please review the attachment.',
p_body_html => 'Please review the attachment'
);

apex_mail.add_attachment (
p_mail_id => l_id,
p_attachment => l_document,
p_filename => 'Book1.xls',
p_mime_type => 'application/vnd.ms-excel');
end;



Thanks in advance
Srivatsan
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 16 2009
Added on May 18 2009
5 comments
1,185 views