The following lines contain the word 'select', 'insert', 'update' or 'delete':
1. Select list of programs with units for the displayed term in the portlet
2. If single program
a. Always use it
else
b. If key program in the list
- Use it
else
- Use the program from the list with the latest commencement date
*/
FUNCTION get_program_info(
p_person_id IN VARCHAR2,
p_load_cal_type IN VARCHAR2,
p_load_sequence_number IN VARCHAR2,
p_num_units IN NUMBER DEFAULT 5
) RETURN VARCHAR2 AS
-- This cursor is to be used if the career_centric model is enabled
CURSOR c_enr_progs_in_prog_cntr IS
SELECT course_cd
FROM igs_en_su_attempt
WHERE person_id = p_person_id
AND unit_attempt_status = 'ENROLLED'
AND (cal_type,ci_sequence_number) IN
(
SELECT teach_cal_type,teach_ci_sequence_number FROM
igs_ca_load_to_teach_v where load_cal_type = p_load_cal_type
AND load_ci_sequence_number = p_load_sequence_number
)
AND rownum <= p_num_units
ORDER BY unit_cd;
SELECT course_cd
FROM igs_en_su_attempt
WHERE person_id = p_person_id
AND unit_attempt_status = 'ENROLLED'
AND (cal_type,ci_sequence_number) IN
(
SELECT teach_cal_type,teach_ci_sequence_number FROM
igs_ca_load_to_teach_v where load_cal_type = p_load_cal_type
AND load_ci_sequence_number = p_load_sequence_number
)
AND course_cd IN (
SELECT course_cd FROM igs_en_stdnt_ps_att
WHERE primary_program_type = 'PRIMARY'
AND person_id = p_person_id
AND course_attempt_status IN ('INACTIVE','ENROLLED')
)
AND rownum <= p_num_units
ORDER BY unit_cd;
SELECT NVL(key_program,'N') , version_number, title
FROM igs_en_sca_v
WHERE COURSE_CD = p_prog_cd
AND PERSON_ID = p_person_id
ORDER BY commencement_dt DESC;
SELECT course_type
FROM igs_ps_ver_all
WHERE course_cd = p_prog_cd
AND version_number = p_ver_num ;