我想改进下面的代码,因为如果我可以为这个触发器避免它,我不在乎拥有所有这些选择语句。我需要在 INSERT 期间为几个字段放置默认值。该代码有效,我只是在寻找其他建议。谢谢!
SET TERM || ;
CREATE TRIGGER populate_defaults FOR units
ACTIVE
BEFORE INSERT
AS
BEGIN
new.value1 = (select value1 from defaults);
new.value2 = (select value2 from defaults);
new.value3 = (select value3 from defaults);
new.value4 = (select value4 from defaults);
new.value5 = (select value5 from defaults);
new.value6 = (select value6 from defaults);
new.value7 = (select value7 from defaults);
new.value8 = (select value8 from defaults);
new.value9 = (select value9 from defaults);
END ||
SET TERM ; ||