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