
CREATE OR ALTER TRIGGER ALUMNOS_MATERIAS_BI FOR ALUMNOS_MATERIAS
ACTIVE BEFORE INSERT POSITION 0
AS
BEGIN
  IF (NEW.NRO_ALUMNO_MATERIA IS NULL) THEN BEGIN
    NEW.NRO_ALUMNO_MATERIA = GEN_ID(ORDEN_GEN, 1);
  END
END