Sunday, December 29, 2024

Query to get Employee Absence details in Oracle APPS

SELECT /*+ rule*/
       paaf.person_id
  ,paaf.assignment_id
  ,flv.meaning absence_category
  ,c.name absence_type
  ,flv1.meaning absence_reason
  ,abs.date_notification
  ,abs.date_projected_start
  ,abs.date_projected_end
  ,abs.date_start
  ,abs.date_end
  ,abs.absence_days
  ,abs.attribute1
  ,abs.attribute2
  ,abs.attribute3
  ,abs.attribute4
  ,abs.attribute5
  ,abs.attribute6
  ,abs.attribute7
  ,abs.attribute8
  ,abs.attribute9
  ,abs.attribute10
  ,abs.attribute11
  ,abs.attribute12
  ,abs.attribute13
  ,abs.attribute14
  ,abs.attribute15
  ,abs.attribute16
  ,abs.attribute17
  ,abs.attribute18
  ,abs.attribute19
  ,abs.attribute20
  ,b.admission_code
  ,b.admission_date
  ,b.amendment_date
      ,b.amendment_reason
  ,b.concatenated_segments
  ,b.contact_grade
      ,b.contact_type
  ,b.discharge_date
  ,b.disease_name
      ,b.hospital_name
  ,b.leave_amended
  ,b.leave_salary_paid
      ,b.physician_approved_accident
  ,b.physician_name
      ,b.resumption_date
  ,b.context
  FROM per_absence_attendances abs
      ,per_absence_attendance_types c
      ,per_abs_attendance_reasons d
      ,per_absence_attendances_dfv b
      ,fnd_lookup_values flv1
      ,fnd_lookup_values flv
      ,per_all_assignments_f paaf          
 WHERE abs.person_id = paaf.person_id
   AND abs.ROWID = b.row_id
   AND abs.absence_attendance_type_id = c.absence_attendance_type_id(+)
   AND abs.abs_attendance_reason_id = d.abs_attendance_reason_id(+)
   AND d.name = flv1.lookup_code(+)
   AND flv1.lookup_type(+) = 'ABSENCE_REASON'
   AND flv.lookup_code(+) = c.absence_category
   AND flv.lookup_type(+) = 'ABSENCE_CATEGORY'
ORDER BY abs.person_id
        ,absence_type
,date_start 
DESC

No comments:

Post a Comment

Query to get Parent and Child Accounts in Oracle APPS R12

SELECT ffv1.flex_value parent_account       ,ffvt1.description parent_account_desc   ,ffv2.flex_value child_account   ,ffvt2.description...