SELECT lp.learning_path_id,
lp.name learning_path_name,
lp.start_date_active lp_start_date,
lp.end_date_active lp_end_date,
lpe.lp_enrollment_id,
lpe.path_status_code,
ota_lrng_path_util.get_lp_current_status(lpe.lp_enrollment_id) learning_path_status,
lpe.completion_date lp_completion_date,
lpe.completion_target_date,
lpe.business_group_id,
oav.activity_version_id,
oav.version_name course_name,
oev.event_id,
oev.title class_name,
oev.course_start_date,
oev.course_start_time,
oev.course_end_date,
oev.course_end_time,
odb.booking_id,
odb.booking_status_type_id,
obst.type booking_status_type,
obst.name class_enrollment_status
FROM ota_learning_paths_vl lp,
ota_lp_enrollments lpe,
ota_learning_path_members lpm,
ota_lp_member_enrollments lpme,
ota_activity_versions_vl oav,
ota_events_vl oev,
ota_delegate_bookings odb,
ota_booking_status_types obst
WHERE lpe.learning_path_id = lp.learning_path_id AND
lpe.lp_enrollment_id = lpme.lp_enrollment_id AND
lpme.learning_path_member_id = lpm.learning_path_member_id AND
lpm.activity_version_id = oav.activity_version_id AND
oav.activity_version_id = oev.activity_version_id AND
oev.event_id = odb.event_id AND
lpe.person_id = odb.delegate_person_id AND
odb.booking_status_type_id = obst.booking_status_type_id AND
lpe.path_status_code <> 'CANCELLED' AND
-- obst.type <> 'C' AND
lpe.person_id = :P_LEARNER_ID AND
decode(:P_LP_STATUS_CODE, null, 'N' , ota_lrng_path_util.get_lp_current_status(lpe.lp_enrollment_id)) = nvl(ota_utility.get_lookup_meaning('OTA_LP_CURRENT_STATUS', :P_LP_STATUS_CODE, 810), 'N')
and ota_admin_access_util.admin_can_access_object('CLP',lp.learning_path_id)='Y'
order by learning_path_name, learning_path_status, class_name |