4. Create Scheduled Programs
I have two types of scheduled programs: one in which a stored procedure is called, and another in which a PLSQL anonymous block is called; see Listing 8.
BEGIN
SYS.DBMS_SCHEDULER.CREATE_PROGRAM
(
program_name => 'REFRESH_TEST.REMOVE_DUMPFILE'
,program_type => 'STORED_PROCEDURE'
,program_action => 'schema_refresh.Remove_dumpfile'
,number_of_arguments => 0
,enabled => TRUE
,comments => 'Delete dumpfile from Dolemite'
);
End;
Listing 9 shows a scheduled program that calls an anonymous block.
BEGIN
SYS.DBMS_SCHEDULER.CREATE_PROGRAM
(
program_name => 'REFRESH_TEST.SEND_EMAIL'
,program_type => 'PLSQL_BLOCK'
,program_action => 'begin Mail.send (''ESCIS.Chain'', ''williams.greg@dol.gov'', ''Successfull Refresh'', ''Successfull Refresh''); END;'
,number_of_arguments => 0
,enabled => TRUE
,comments => 'Send Email When Successfull'
);
End;


