-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- TRIGGER BEFORE INSERT
-- Tabla: sga_responsables_academicas
-- Version 3.0.0
-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- DROP FUNCTION ftib_sga_responsables_academicas();
CREATE OR REPLACE FUNCTION ftib_sga_responsables_academicas() RETURNS TRIGGER AS $BODY$
  BEGIN
       -- Genera un registro en la tabla de entidades..
       NEW.entidad := f_generar_entidad(101);
       RETURN NEW;
  END;
$BODY$ LANGUAGE plpgsql;


-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- Trigger de INSERT sobre sga_responsables_academicas
-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- DROP TRIGGER tib_sga_responsables_academicas ON sga_responsables_academicas RESTRICT;
CREATE TRIGGER tib_sga_responsables_academicas BEFORE INSERT ON sga_responsables_academicas
    FOR EACH ROW EXECUTE PROCEDURE ftib_sga_responsables_academicas();
