title: check age trigger from two separate tables in oracle sql
body: <p>I need to create a trigger that checks that the age (in years) of the participant is higher than the minimum age of the race he/ she participates in. To do this I need to get information from the participants table and the race table. I need to add this trigger to the results table
  here are my tables:</p>
  
  <pre><code>CREATE TABLE race 
  ( 
  RaceID int, 
  Location varchar2 (60), 
  StartDate Date, 
  RaceTime Date, 
  MinAge int, 
  );
  
  CREATE TABLE participant
  (
  ParticipantID int,
  "Name" varchar2 (60),
  DateOfBirth date,
  Sex varchar2 (1),
  Age int
  );
  
  CREATE TABLE results
  (
  RaceID int not null unique,
  ParticipantID int not null unique,
  position number (2)
  );
  </code></pre>
  
  <p>here is what I have created so far:</p>
  
  <pre><code> create or replace TRIGGER dob_trg
    BEFORE INSERT OR UPDATE ON RESULTS
    FOR EACH ROW
  DECLARE
  RACE_MINAGE NUMBER;
  PARTICIPANT_AGE NUMBER;
  BEGIN
    SELECT RACE.MINAGE, PARTICIPANT.AGE
      INTO RACE_MINAGE, PARTICIPANT_AGE
      FROM RACE PARTICIPANT
     WHERE RACE.RACEID = :NEW.RACEID; 
    IF : NEW.AGE &lt; : NEW.MINAGE THEN
      RAISE_APPLICATION_ERROR(-20000, 'Participant too young!');
    END IF;
  enddob_trg;
  </code></pre>
  
  <p>However I'm getting the following error
  Error(9,6): PLS-00103: Encountered the symbol ":"</p>
  
  <p>Any help greatly appreciated!</p>