create or replace procedure enroll_student_in_class(p_s_id IN enrollments.stu_id%TYPE,p_c_id IN enrollments.class_id%type)
as
v number(2);
begin
INSERT INTO enrollments
(stu_id, class_id, enrollment_date, status)
VALUES (p_s_id, p_c_id, SYSDATE,'Enrolled');
select stu_id into v from enrollments where stu_id=p_s_id;
exception
WHEN too_many_rows THEN
        dbms_output.put_line('the student is already enrolled.');
END;