DROP TRIGGER TTBCONSUMO_REQUISICAO_B0U_05;

CREATE trigger ttbconsumo_requisicao_b05i for tbconsumo_requisicao
active before insert position 5
AS
BEGIN
    IF(COALESCE(NEW.REQUISICAO_PAI, '') = '') THEN
    BEGIN
        NEW.REQUISICAO_PAI = NEW.ID;
    END
END;

COMMENT ON TRIGGER TTBCONSUMO_REQUISICAO_B05I IS 'INSERIR REQUISICAO PAI CASO NAO FOR ALIMENTADA';