DBA Data[Home] [Help]

VIEW: APPS.PER_WORK_INCIDENTS_V

Source

View Text - Preformatted

SELECT inc.incident_id ,per.business_group_id ,per.person_id ,inc.assignment_id ,hr_general.decode_job(asg.job_id) ,inc.incident_reference ,inc.incident_type ,substr(hr_general.decode_lookup('INCIDENT_TYPE', inc.incident_type), 1, 30) ,inc.incident_date ,to_date(inc.incident_time,'HH24:MI') ,inc.org_notified_date ,inc.location ,inc.at_work_flag ,substr(hr_general.decode_lookup('AT_WORK_FLAG',inc.at_work_flag),1,30) ,inc.report_date ,to_date(inc.report_time,'HH24:MI') ,inc.report_method ,substr(hr_general.decode_lookup('PER_CM_MTHD',inc.report_method),1,30) ,inc.person_reported_by ,substr(hr_general.decode_person_name(inc.person_reported_by),1,60) ,inc.person_reported_to ,inc.witness_details ,inc.description ,inc.injury_type ,substr(hr_general.decode_lookup('INJURY_TYPE',inc.injury_type),1,30) ,inc.disease_type ,substr(hr_general.decode_lookup('DISEASE_TYPE',inc.disease_type),1,30) ,inc.hazard_type ,substr(hr_general.decode_lookup('HAZARD_TYPE',inc.hazard_type),1,30) ,inc.body_part ,inc.treatment_received_flag ,inc.hospital_details ,inc.hospital_address ,inc.activity_at_time_of_work ,inc.objects_involved ,inc.hospitalized_flag ,inc.privacy_issue ,inc.emergency_code ,inc.days_restricted_work ,inc.days_away_from_work ,to_date(inc.work_start_time,'HH24:MI') ,inc.report_completed_by ,inc.reporting_person_title ,inc.reporting_person_phone ,inc.date_of_death ,inc.doctor_name ,inc.compensation_date ,inc.compensation_currency ,inc.compensation_amount ,inc.remedial_hs_action ,inc.notified_hsrep_id ,substr(hr_general.decode_person_name(inc.notified_hsrep_id),1,60) ,inc.notified_hsrep_date ,inc.notified_rep_id ,substr(hr_general.decode_person_name(inc.notified_rep_id),1,60) ,inc.notified_rep_date ,inc.notified_rep_org_id ,org.name ,inc.related_incident_id ,per_inc_bus.get_incident_reference(inc.related_incident_id) ,inc.absence_exists_flag ,inc.over_time_flag ,inc.inc_information_category ,inc.inc_information1 ,inc.inc_information2 ,inc.inc_information3 ,inc.inc_information4 ,inc.inc_information5 ,inc.inc_information6 ,inc.inc_information7 ,inc.inc_information8 ,inc.inc_information9 ,inc.inc_information10 ,inc.inc_information11 ,inc.inc_information12 ,inc.inc_information13 ,inc.inc_information14 ,inc.inc_information15 ,inc.inc_information16 ,inc.inc_information17 ,inc.inc_information18 ,inc.inc_information19 ,inc.inc_information20 ,inc.inc_information21 ,inc.inc_information22 ,inc.inc_information23 ,inc.inc_information24 ,inc.inc_information25 ,inc.inc_information26 ,inc.inc_information27 ,inc.inc_information28 ,inc.inc_information29 ,inc.inc_information30 ,inc.attribute_category ,inc.attribute1 ,inc.attribute2 ,inc.attribute3 ,inc.attribute4 ,inc.attribute5 ,inc.attribute6 ,inc.attribute7 ,inc.attribute8 ,inc.attribute9 ,inc.attribute10 ,inc.attribute11 ,inc.attribute12 ,inc.attribute13 ,inc.attribute14 ,inc.attribute15 ,inc.attribute16 ,inc.attribute17 ,inc.attribute18 ,inc.attribute19 ,inc.attribute20 ,inc.attribute21 ,inc.attribute22 ,inc.attribute23 ,inc.attribute24 ,inc.attribute25 ,inc.attribute26 ,inc.attribute27 ,inc.attribute28 ,inc.attribute29 ,inc.attribute30 ,inc.last_update_date ,inc.last_updated_by ,inc.last_update_login ,inc.created_by ,inc.creation_date ,inc.object_version_number FROM per_work_incidents inc ,per_people_f per ,per_assignments_f asg ,hr_all_organization_units org ,fnd_sessions ses WHERE inc.person_id = per.person_id AND ses.effective_date BETWEEN per.effective_start_date AND per.effective_end_date AND inc.assignment_id = asg.assignment_id (+) AND inc.incident_date BETWEEN nvl(asg.effective_start_date,hr_general.start_of_time) AND nvl(asg.effective_end_date,hr_general.end_of_time) AND inc.notified_rep_org_id = org.organization_id (+) AND ses.session_id = userenv('SESSIONID')
View Text - HTML Formatted

SELECT INC.INCIDENT_ID
, PER.BUSINESS_GROUP_ID
, PER.PERSON_ID
, INC.ASSIGNMENT_ID
, HR_GENERAL.DECODE_JOB(ASG.JOB_ID)
, INC.INCIDENT_REFERENCE
, INC.INCIDENT_TYPE
, SUBSTR(HR_GENERAL.DECODE_LOOKUP('INCIDENT_TYPE'
, INC.INCIDENT_TYPE)
, 1
, 30)
, INC.INCIDENT_DATE
, TO_DATE(INC.INCIDENT_TIME
, 'HH24:MI')
, INC.ORG_NOTIFIED_DATE
, INC.LOCATION
, INC.AT_WORK_FLAG
, SUBSTR(HR_GENERAL.DECODE_LOOKUP('AT_WORK_FLAG'
, INC.AT_WORK_FLAG)
, 1
, 30)
, INC.REPORT_DATE
, TO_DATE(INC.REPORT_TIME
, 'HH24:MI')
, INC.REPORT_METHOD
, SUBSTR(HR_GENERAL.DECODE_LOOKUP('PER_CM_MTHD'
, INC.REPORT_METHOD)
, 1
, 30)
, INC.PERSON_REPORTED_BY
, SUBSTR(HR_GENERAL.DECODE_PERSON_NAME(INC.PERSON_REPORTED_BY)
, 1
, 60)
, INC.PERSON_REPORTED_TO
, INC.WITNESS_DETAILS
, INC.DESCRIPTION
, INC.INJURY_TYPE
, SUBSTR(HR_GENERAL.DECODE_LOOKUP('INJURY_TYPE'
, INC.INJURY_TYPE)
, 1
, 30)
, INC.DISEASE_TYPE
, SUBSTR(HR_GENERAL.DECODE_LOOKUP('DISEASE_TYPE'
, INC.DISEASE_TYPE)
, 1
, 30)
, INC.HAZARD_TYPE
, SUBSTR(HR_GENERAL.DECODE_LOOKUP('HAZARD_TYPE'
, INC.HAZARD_TYPE)
, 1
, 30)
, INC.BODY_PART
, INC.TREATMENT_RECEIVED_FLAG
, INC.HOSPITAL_DETAILS
, INC.HOSPITAL_ADDRESS
, INC.ACTIVITY_AT_TIME_OF_WORK
, INC.OBJECTS_INVOLVED
, INC.HOSPITALIZED_FLAG
, INC.PRIVACY_ISSUE
, INC.EMERGENCY_CODE
, INC.DAYS_RESTRICTED_WORK
, INC.DAYS_AWAY_FROM_WORK
, TO_DATE(INC.WORK_START_TIME
, 'HH24:MI')
, INC.REPORT_COMPLETED_BY
, INC.REPORTING_PERSON_TITLE
, INC.REPORTING_PERSON_PHONE
, INC.DATE_OF_DEATH
, INC.DOCTOR_NAME
, INC.COMPENSATION_DATE
, INC.COMPENSATION_CURRENCY
, INC.COMPENSATION_AMOUNT
, INC.REMEDIAL_HS_ACTION
, INC.NOTIFIED_HSREP_ID
, SUBSTR(HR_GENERAL.DECODE_PERSON_NAME(INC.NOTIFIED_HSREP_ID)
, 1
, 60)
, INC.NOTIFIED_HSREP_DATE
, INC.NOTIFIED_REP_ID
, SUBSTR(HR_GENERAL.DECODE_PERSON_NAME(INC.NOTIFIED_REP_ID)
, 1
, 60)
, INC.NOTIFIED_REP_DATE
, INC.NOTIFIED_REP_ORG_ID
, ORG.NAME
, INC.RELATED_INCIDENT_ID
, PER_INC_BUS.GET_INCIDENT_REFERENCE(INC.RELATED_INCIDENT_ID)
, INC.ABSENCE_EXISTS_FLAG
, INC.OVER_TIME_FLAG
, INC.INC_INFORMATION_CATEGORY
, INC.INC_INFORMATION1
, INC.INC_INFORMATION2
, INC.INC_INFORMATION3
, INC.INC_INFORMATION4
, INC.INC_INFORMATION5
, INC.INC_INFORMATION6
, INC.INC_INFORMATION7
, INC.INC_INFORMATION8
, INC.INC_INFORMATION9
, INC.INC_INFORMATION10
, INC.INC_INFORMATION11
, INC.INC_INFORMATION12
, INC.INC_INFORMATION13
, INC.INC_INFORMATION14
, INC.INC_INFORMATION15
, INC.INC_INFORMATION16
, INC.INC_INFORMATION17
, INC.INC_INFORMATION18
, INC.INC_INFORMATION19
, INC.INC_INFORMATION20
, INC.INC_INFORMATION21
, INC.INC_INFORMATION22
, INC.INC_INFORMATION23
, INC.INC_INFORMATION24
, INC.INC_INFORMATION25
, INC.INC_INFORMATION26
, INC.INC_INFORMATION27
, INC.INC_INFORMATION28
, INC.INC_INFORMATION29
, INC.INC_INFORMATION30
, INC.ATTRIBUTE_CATEGORY
, INC.ATTRIBUTE1
, INC.ATTRIBUTE2
, INC.ATTRIBUTE3
, INC.ATTRIBUTE4
, INC.ATTRIBUTE5
, INC.ATTRIBUTE6
, INC.ATTRIBUTE7
, INC.ATTRIBUTE8
, INC.ATTRIBUTE9
, INC.ATTRIBUTE10
, INC.ATTRIBUTE11
, INC.ATTRIBUTE12
, INC.ATTRIBUTE13
, INC.ATTRIBUTE14
, INC.ATTRIBUTE15
, INC.ATTRIBUTE16
, INC.ATTRIBUTE17
, INC.ATTRIBUTE18
, INC.ATTRIBUTE19
, INC.ATTRIBUTE20
, INC.ATTRIBUTE21
, INC.ATTRIBUTE22
, INC.ATTRIBUTE23
, INC.ATTRIBUTE24
, INC.ATTRIBUTE25
, INC.ATTRIBUTE26
, INC.ATTRIBUTE27
, INC.ATTRIBUTE28
, INC.ATTRIBUTE29
, INC.ATTRIBUTE30
, INC.LAST_UPDATE_DATE
, INC.LAST_UPDATED_BY
, INC.LAST_UPDATE_LOGIN
, INC.CREATED_BY
, INC.CREATION_DATE
, INC.OBJECT_VERSION_NUMBER
FROM PER_WORK_INCIDENTS INC
, PER_PEOPLE_F PER
, PER_ASSIGNMENTS_F ASG
, HR_ALL_ORGANIZATION_UNITS ORG
, FND_SESSIONS SES
WHERE INC.PERSON_ID = PER.PERSON_ID
AND SES.EFFECTIVE_DATE BETWEEN PER.EFFECTIVE_START_DATE
AND PER.EFFECTIVE_END_DATE
AND INC.ASSIGNMENT_ID = ASG.ASSIGNMENT_ID (+)
AND INC.INCIDENT_DATE BETWEEN NVL(ASG.EFFECTIVE_START_DATE
, HR_GENERAL.START_OF_TIME)
AND NVL(ASG.EFFECTIVE_END_DATE
, HR_GENERAL.END_OF_TIME)
AND INC.NOTIFIED_REP_ORG_ID = ORG.ORGANIZATION_ID (+)
AND SES.SESSION_ID = USERENV('SESSIONID')