【发布时间】:2019-11-24 12:24:11
【问题描述】:
也许这太简单了,但我对这项任务感到头疼,我正在为一些作业建立一个健身房数据库,我必须分别根据名为身高和体重的其他行计算 BMI。我不知道更新这个表的方法,我已经尝试过
create or replace trigger calculate_BMI
after insert or update on evaluation
begin
update evaluation
set BMI = i.bmi, weight = weight(height*height)
from inserted as i
end
这就是我发现的
SQL Error: ORA-04098: trigger 'BJ111237.CALCULATE_BMI' is invalid and failed re-validation
04098. 00000 - "trigger '%s.%s' is invalid and failed re-validation"
*Cause: A trigger was attempted to be retrieved for execution and was
found to be invalid. This also means that compilation/authorization
failed for the trigger.
*Action: Options are to resolve the compilation/authorization errors,
disable the trigger, or drop the trigger.
它不起作用,如果有人带我看一些内容来学习如何正确执行此操作,我将不胜感激,因为我被卡住了
【问题讨论】:
标签: oracle plsql database-trigger