SET TERM ^ ;

CREATE trigger ttbpdv_conferencia_item_b03iu for tbpdv_conferencia_item
active before insert or update position 3
AS
BEGIN
   NEW.EAN = COALESCE((SELECT FIRST 1 T.EAN FROM TBEAN T WHERE T.MODELO_ID = NEW.MODELO_ID AND T.COR_ID = NEW.COR_ID AND T.TAMANHO = NEW.TAMANHO), '');
END
^

SET TERM ; ^

