Plsql PL/SQL触发器游标错误

Plsql PL/SQL触发器游标错误,plsql,triggers,oracle10g,Plsql,Triggers,Oracle10g,我几乎是个新手。我的扳机有问题。我想在项目表中插入一个新的city projects.plocations,它是光标“cur”定义所选的项目之一。 当我执行时,我得到了以下错误: 12/21 PLS-00103:Trovato il simbolo=anzichÚuno dei segunti 翻译:12/21 PLS-00103:在预期以下情况时遇到符号“=”: 但是,如果我在没有行的情况下执行,则不会出现错误: **if (:new.plocation := city) then c=1;

我几乎是个新手。我的扳机有问题。我想在项目表中插入一个新的city projects.plocations,它是光标“cur”定义所选的项目之一。 当我执行时,我得到了以下错误:

12/21 PLS-00103:Trovato il simbolo=anzichÚuno dei segunti

翻译:12/21 PLS-00103:在预期以下情况时遇到符号“=”:

但是,如果我在没有行的情况下执行,则不会出现错误:

**if (:new.plocation := city) then
c=1;
end if;**
你能告诉我为什么吗

create or replace trigger tr_projects
before insert on projects
for each row
declare
exc exception;
cursor cur is (
    (select dlocation from dept_locations) minus (select plocation from projects));
city varchar(30);
c number(1):=0;
begin
open cur;
loop
fetch cur into city;
exit when cur%notfound;
if (:new.plocation := city) then
    c=1;
end if;
end loop;
close cur;
if c=0 then
raise exc;
end if;
exception
when exc then
raise_application_error(-20001,'Unknown city');
end;
改变

if (:new.plocation := city) then
    c=1;
end if;


:=是赋值运算符,=是比较运算符

Ok。完成。但它再次显示了相同的错误和相同的行。如果您使用@Franktrt下面这行的答案中提供的信息,您能解决您的问题吗?完成。非常感谢。在下一行中为c:=1。它现在没有显示错误。可能是的重复项
if (:new.plocation = city) then
    c := 1;
end if;