create or replace procedure drop_student_from_class (p_s_id IN enrollments.stu_id%TYPE,p_c_id IN enrollments.class_id%type)
as
nu_exista exception;
BEGIN
DELETE FROM enrollments
WHERE stu_id=p_s_id
AND class_id=p_c_id;
IF (SQL%ROWCOUNT<>0) THEN DBMS_OUTPUT.PUT_LINE('The student with the id '||p_s_id||' was deleted from class id '||p_c_id);
else raise nu_exista;
END IF;
exception
when nu_exista then dbms_output.put_line('exceptia este: the student is not in the class');
COMMIT;
END;