title: Declaration of variable in trigger
body: <p>How to declare <code>temp</code> variable, though I already studied syntax, and according to me, it is right, but then too, it shows error :<code>Undefined temp and t.</code></p>
  
  <pre><code>CREATE TRIGGER check_reciever BEFORE INSERT
  ON one_to_one FOR each row
  BEGIN
  select employee_id into temp from employee_master where employee_id = NEW.reciever_id;
  IF temp!=0 THEN
  insert into one_to_one values(new.message_id,new.reciever_id,new.read);
  ELSE
     select count(*) into t from parent_master where parent_id=new.reciever_id;
     IF t!=0 THEN
       insert into one_to_one values(new.message_id,new.reciever_id,new.read);
     END IF;
  END IF;
  END
  </code></pre>