解释每行代码含义create trigger biufer_employee__job_idbefore insert or updateof job_idon employeereferencing old as old_valuenew as new_valuefor each rowwhen (new_value.job_id3 )begin:new_value.commission_pct :=0;end;
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/25 00:31:40
解释每行代码含义create trigger biufer_employee__job_idbefore insert or updateof job_idon employeereferencing old as old_valuenew as new_valuefor each rowwhen (new_value.job_id3 )begin:new_value.commission_pct :=0;end;
解释每行代码含义
create trigger biufer_employee__job_id
before insert or update
of job_id
on employee
referencing old as old_value
new as new_value
for each row
when (new_value.job_id3 )
begin
:new_value.commission_pct :=0;
end;
解释每行代码含义create trigger biufer_employee__job_idbefore insert or updateof job_idon employeereferencing old as old_valuenew as new_valuefor each rowwhen (new_value.job_id3 )begin:new_value.commission_pct :=0;end;
创建一个触发器的语句
create trigger biufer_employee__job_id
before insert or update
of job_id
on employee
在biufer_employee__job_id的job_id字段上创建触发器,
old 和 new分别代表执行前后的值,下面的语句是给他们起个别名
referencing old as old_value
new as new_value
for eache row就是循环每一行的数据拉
when (new_value.job_id3 )
begin
:new_value.commission_pct :=0;
end;
上面的是当新的值的.job_id不等于3的时候.执行begin里面的内容
设置new_value的commission_pct字段为0