title: Check Condition with SELECT in oracle trigger
body: <p>What is problem in my trigger?
  I use toad for oracle<br>
  After executing this sql toad show this message and no more!:</p>
  
  <pre><code>Warning: compiled but with compilation errors
  </code></pre>
  
  <p>and trigger does not work</p>
  
  <p>my trigger is here:</p>
  
  <pre><code>CREATE OR REPLACE TRIGGER trg_delete_mmtp_user_feature
     BEFORE DELETE
     ON mmtp_user
     FOR EACH ROW
  BEGIN
  -- for these cases delete not allowed
     IF ((SELECT COUNT (*)
            FROM payment p INNER JOIN mmtp_user mt
                 ON mt.customer_id = p.requester_id
           WHERE p.rp_reason_id = 20 AND mt.mmtp_user_id = :OLD.mmtp_user_id) &gt;
                                                                               0
        )
     THEN
        raise_application_error
               (-20654,
                'Query has attempted to delete MMTP_USER with existing payment'
               );
  
     ELSE                            --befor deleting features should be deleted
        DELETE FROM mmtp_user_feature
              WHERE mmtp_user_id = :OLD.mmtp_user_id;
     END IF;
  END;
  /
  </code></pre>
  
  <p>and for deleting i receive this message:</p>
  
  <pre><code>ORA-04098: trigger 'DEVX2.TRG_DELETE_MMTP_USER_FEATURE' is invalid and failed re-validation
  </code></pre>