title: MySQL After Insert Trigger with Variable
body: <p>I've created this trigger, but I have two problems. One it does not actively populate the Person table and two. If I enter more than one row into my Party table I get an error in access, Result of Subquery returns more than one row.
  Anybody know my problem(s)? </p>
  
  <pre><code>DELIMITER $$
  Create TRIGGER Trigger1
  
    AFTER
    INSERT
    ON Party
    FOR EACH ROW
    BEGIN
  
  declare partytypeid  int;
  declare partyid  int;
  
  set @partyid:= (select partyid from party);
  set @partytypeid:= (select partytypeid from party);
  
        IF partytypeid = 1 
          THEN  INSERT INTO Person
          (PartyId) VALUES (PartyId);
          END IF;    
  
      END$$
      delimiter ;
  </code></pre>