create or replace procedure course_roster (p_i_id number,p_c_id number)
as
CURSOR stud_class_cur IS
SELECT e.class_id, e.status, s.first_name, s.last_name
FROM enrollments e join students s on e.stu_id=s.stu_id join classes c on e.class_id=c.class_id
where c.course_id=p_c_id
AND c.instr_id=p_i_id;
BEGIN
DBMS_OUTPUT.PUT_LINE('The students from the course with id:'||p_c_id||' are:');
FOR stud_class_rec IN stud_class_cur
LOOP
DBMS_OUTPUT.PUT_LINE(stud_class_rec.first_name||'  '||stud_class_rec.last_name||' from class:'||stud_class_rec.class_id||' with status:'||stud_class_rec.status);
END LOOP;
END;