All pastes #884434 Raw Edit

Unbenannt

public text v1 · immutable
#884434 ·published 2008-01-30 10:37 UTC
rendered paste body
create or replace trigger trig_einbau before INSERT or UPDATE ON Einbau
	for each row
	declare Baugrp Bauteil.Baugruppe%TYPE;
	BEGIN
			if inserting then
				  select Baugruppe INTO Baugrp from Bauteil where Bauteil.BtNr = :new.BtNr;
				  if Baugrp = NULL then
					    return;
				  END IF;
					Select sq_einbau.nextval into :new.EbNr from dual;
			END IF;
			 
			if updating then
					:new.EbNr := :old.EbNr;
			END IF;
  	END;