oracle ORA-00927: 缺少等号
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/30251569/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 02:51:58 来源:igfitidea点击:
ORA-00927: missing equal sign
提问by cafej
Im creating my first sql trigger,
我正在创建我的第一个 sql 触发器,
CREATE OR REPLACE TRIGGER totalsalary
AFTER INSERT ON Employee
FOR EACH ROW
WHEN ( NEW.Dno IS NOT NULL )
BEGIN
UPDATE Department
SET totalSalary totalSalary + NEW.salary
WHERE Dno = NEW.Dno;
END
;
but i got this error message and i dont know how to fix it
但我收到此错误消息,我不知道如何修复它
Error at line 3: PL/SQL: ORA-00927: missing equal sign
1. CREATE OR REPLACE TRIGGER SueldoTotal
2. AFTER INSERT ON EMPLEADO
3. FOR EACH ROW
4. WHEN ( NEW.Dno IS NOT NULL )
5. BEGIN
回答by Lalit Kumar B
SET totalSalary totalSalary + NEW.salary
SET totalSalary totalSalary + NEW.salary
You have a missing equal signin the SETclause.
你有一个丢失等号中SET子句。
CREATE OR REPLACE TRIGGER totalsalary
AFTER INSERT ON Employee
FOR EACH ROW
WHEN ( NEW.Dno IS NOT NULL )
BEGIN
UPDATE Department
SET totalSalary = totalSalary + :NEW.salary
WHERE Dno = :NEW.Dno;
END;
/
NEW.salary
新工资
Also, this is incorrect while referencing OLD and NEW values:
此外,在引用 OLD 和 NEW 值时这是不正确的:
:NEW.salary