Hello,
try this ..
Create or Replace Trigger Enroll_Rule
Before Insert on Enrollment
For Each Row
DECLARE
nCount PLS_INTEGER := 0;
no_course_found EXCEPTION;
Begin
SELECT COUNT(1) INTO nCount
FROM Enrollment WHERE stdid = :new.stdid
AND CourseNumber IN (2201, 2203);
IF nCount <> 2 THEN
RAISE no_course_found;
END IF;
END;
... Hope that helps ?
Best regards
Manfred Peter
(Alligator Company GmbH)
http://www.alligatorsql.com