Alerts For Employee Birthday

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Alerts for Employee Birthday – Employee and Manager

April 21, 2013

Alert Query for the Employee greeting the birthday wishes

SELECT employee_number, full_name,papf.DATE_OF_BIRTH,

xxcust_hrms_general.get_supervisor_email (papf.person_id),

xxcust_hrms_general.get_roles_person_mail(‘XX_HR_Manager’),

xxcust_hrms_general.get_roles_person_mail(‘XX_Payroll_Exe’)

INTO &empno, &fullname, &date_of_birth,

&manager_email,

&hr_mail,

&hr_mail1

FROM per_all_people_f papf,per_all_assignments_f paaf,per_all_positions pap

WHERE 1 = 1

AND TO_CHAR (papf.DATE_OF_BIRTH , ‘DD-MON’) =

TO_CHAR (SYSDATE + 1, ‘DD-MON’)

AND SYSDATE BETWEEN papf.effective_start_date AND papf.effective_end_date

AND papf.current_employee_flag = ‘Y’

AND paaf.person_id=papf.person_id

AND trunc(SYSDATE) BETWEEN paAf.effective_start_date AND paAf.effective_end_date

AND paaf.assignment_type=’E’

AND paaf.primary_flag=’Y’

AND substr(pap.name,1,instr(pap.name,’.’)-1) NOT IN (‘XXHR’,’XXAD’,’XXXX’)

AND paaf.position_id=pap.position_id

AND papf.employee_number not in (‘10237’)

Short Note on Alerts.

Introduction:
Oracle Alerts is something that can be used to Notify/Alert to one or multiple persons about an
activity or change that occurs in the system. The alerts can also be used to call a procedure, run
some sql script etc.
There are 2 types of alert
1) Periodic Alert
2) Event Alert

Periodic Alerts:
These alerts are trigger periodically, hourly, daily, weekly, monthly etc based upon how it is setup to
be triggered. When alert runs and the condition(SQL Query etc.) in the alerts fetches record, then
the events specified in the alert are triggered.
Ex. 1) Daily alert to send notification on the sales order on which credit check hold is applied for a
day
2) Hourly alert to send notification on all the concurrent request that completed with error

Event Alerts:
These Alerts are fired/triggered based on some change in data in the database. This is very similar
to the triggers written on the table. Unlikely, event alerts can only fire on After Insert or After Update.
Ex. 1) An alert that sends notification when new item is created

You might also like