Tascha Task Scheduler


Package taschx_pkg

Package used to execute scheduled tasks


Field Summary
 task_logs.sid%TYPEG_dbsid
           Simply caches SID for logging use
 BOOLEANG_log_debug
           Specifies whether logger_debug active
 BOOLEANG_log_errors
           Specifies whether logger_error active
 BOOLEANG_log_info
           Specifies whether logger_info active
 VARCHAR2(255)G_send_mail_admin
           Stores email address to use as sender of emails.
 VARCHAR2(255)G_send_mail_host
           Stores SMTP gateway for sending emails.
 NUMBER(5)G_send_mail_port
           Stores port for SMTP gateway for sending emails.
 task_logs.run_no%TYPEG_this_run_no
           Stores current run number in call_job so custom code can use logger* procs
 task_logs.sched_id%TYPEG_this_sched_id
           Stores current sched ID in call_job so custom code can use logger* procs
 CHAR(1)GC_fri
           Constant holding numeric value for Friday
 CHAR(1)GC_mon
           Constant holding numeric value for Monday
 CHAR(1)GC_sat
           Constant holding numeric value for Saturday
 CHAR(1)GC_sun
           Constant holding numeric value for Sunday
 CHAR(1)GC_thu
           Constant holding numeric value for Thursday
 CHAR(1)GC_tue
           Constant holding numeric value for Tuesday
 CHAR(1)GC_wed
           Constant holding numeric value for Wednesday

Method Summary
 call_job(i_dbms_job_id NUMBER)
           Calls the procedure specified by the task and scheduled parameters.
 check_schedule()
           Wakes up via dbms_job and schedules new tasks also using dbms_job.
 logger_debug(i_log_txt VARCHAR2, i_sched_id NUMBER DEFAULT NULL, i_run_no NUMBER DEFAULT NULL)
           Logs messages at debug level.
 logger_error(i_log_txt VARCHAR2, i_sched_id NUMBER DEFAULT NULL, i_run_no NUMBER DEFAULT NULL)
           Logs messages at error level.
 logger_flush()
           Writes log messages to logs table
 logger_info(i_log_txt VARCHAR2, i_sched_id NUMBER DEFAULT NULL, i_run_no NUMBER DEFAULT NULL)
           Logs messages at info level.

Field Detail

G_log_debug

  public BOOLEAN G_log_debug
Specifies whether logger_debug active

G_log_info

  public BOOLEAN G_log_info
Specifies whether logger_info active

G_log_errors

  public BOOLEAN G_log_errors
Specifies whether logger_error active

G_dbsid

  public task_logs.sid%TYPE G_dbsid
Simply caches SID for logging use

G_this_sched_id

  public task_logs.sched_id%TYPE G_this_sched_id
Stores current sched ID in call_job so custom code can use logger* procs

G_this_run_no

  public task_logs.run_no%TYPE G_this_run_no
Stores current run number in call_job so custom code can use logger* procs

GC_mon

  public CHAR(1) GC_mon
Constant holding numeric value for Monday

GC_tue

  public CHAR(1) GC_tue
Constant holding numeric value for Tuesday

GC_wed

  public CHAR(1) GC_wed
Constant holding numeric value for Wednesday

GC_thu

  public CHAR(1) GC_thu
Constant holding numeric value for Thursday

GC_fri

  public CHAR(1) GC_fri
Constant holding numeric value for Friday

GC_sat

  public CHAR(1) GC_sat
Constant holding numeric value for Saturday

GC_sun

  public CHAR(1) GC_sun
Constant holding numeric value for Sunday

G_send_mail_host

  public VARCHAR2(255) G_send_mail_host
Stores SMTP gateway for sending emails. Replace with value on a table.

G_send_mail_port

  public NUMBER(5) G_send_mail_port
Stores port for SMTP gateway for sending emails. Replace with value on a table.

G_send_mail_admin

  public VARCHAR2(255) G_send_mail_admin
Stores email address to use as sender of emails. Replace with value on a table.

Method Detail

check_schedule

  public  check_schedule()
Wakes up via dbms_job and schedules new tasks also using dbms_job. Does this so that jobs do not have to wait for each other to finish. They all launch at around same moment.

call_job

  public  call_job(i_dbms_job_id NUMBER)
Calls the procedure specified by the task and scheduled parameters. Called via dbms_job from scheduler().
Throws:
missing_procedure_name -

logger_info

  public  logger_info(i_log_txt VARCHAR2, 
i_sched_id NUMBER DEFAULT NULL,
i_run_no NUMBER DEFAULT NULL)
Logs messages at info level.
Parameters:
i_log_txt - Message to log
i_sched_id - ID of scheduled task
i_run_no - Used to ID the current instance of a scheduled job run (mainly for logging)

logger_debug

  public  logger_debug(i_log_txt VARCHAR2, 
i_sched_id NUMBER DEFAULT NULL,
i_run_no NUMBER DEFAULT NULL)
Logs messages at debug level.
Parameters:
i_log_txt - Message to log
i_sched_id - ID of scheduled task
i_run_no - Used to ID the current instance of a scheduled job run (mainly for logging)

logger_error

  public  logger_error(i_log_txt VARCHAR2, 
i_sched_id NUMBER DEFAULT NULL,
i_run_no NUMBER DEFAULT NULL)
Logs messages at error level.
Parameters:
i_log_txt - Message to log
i_sched_id - ID of scheduled task
i_run_no - Used to ID the current instance of a scheduled job run (mainly for logging)

logger_flush

  public  logger_flush()
Writes log messages to logs table

Tascha Task Scheduler