'How to "come out" from AFTER INSERT trigger when new data is inserted

I have tried to create trigger which does not allow completely ignore some table (TABLEB) and leave data empty in there. This works when nothing is inserted but how to come out from this trigger when something is added in TABLEB? I mean even if i insert or not it keeps saying "Data missing".

  AFTER INSERT OR UPDATE ON TABLEA
  FOR each ROW
DECLARE
    v_id number;
BEGIN
    SELECT COUNT(*)
    INTO   v_id
    FROM   id.TABLEB
    WHERE  id = v_id;
    IF v_id = 0 
    THEN raise_application_error(-20001, 
    'Data missing');
    END IF;
END;``

Oracle 19 in use. Help is appreciated. Thanks.


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source