트리거가 거의 없습니다. 이 방아쇠에 문제가 있습니다. 커서 'cur'의 정의에 의해 선택된 것 중 하나 인 새로운 도시 (projects.plocations)를 프로젝트 테이블에 삽입하고 싶습니다. 실행하면이 오류가 발생합니다.PL/SQL 트리거 커서 오류
12/21 PLS-00103 : Trovato il simbolo "="anzichÚ uno dei seguenti.
번역 : 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;
중복 가능성 (HTTP 인 : //stackoverflow.com/questions/19066540/encountered-the-symbol) – Ben