ORA-00927:缺少等号

我创建了我的第一个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

;

但我收到此错误消息,但我不知道如何解决它

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

回答:

设置totalSalary totalSalary + NEW.salary

您在 。 *

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

以上是 ORA-00927:缺少等号 的全部内容, 来源链接: utcz.com/qa/424008.html

回到顶部