2017-12-11 4 views
0

내 테이블이 트리거를 컴파일하려고 노력하고 난이 오류가 계속 :오라클 데이터베이스 컴파일 오류

오류 메시지

Compilation failed, line 4 (19:39:58) The line numbers associated with compilation errors are relative to the first BEGIN statement. This only affects the compilation of database triggers. PL/SQL: ORA-00923: FROM keyword not found where expected

Compilation failed, line 4 (19:39:58) The line numbers associated with compilation errors are relative to the first BEGIN statement. This only affects the compilation of database triggers. PL/SQL: SQL Statement ignored

이 내 트리거입니다

create or replace TRIGGER NEWSALARY 
before 
insert or update on CREW 
for each row 
Declare 
v_emphours AIRPLANE. EMPWORKINGHOURS%TYPE; 
BEGIN 
select EMPWORKINGHOURS into v_ emphours from "AIRPLANE" Where AIRPLANEID =:NEW."AirPlaneID"; 
if 
v_emphours > 8 
then 
:NEW."Salary":= :NEW."Salary"* 50; 
END IF; 
End; 

답변

2

dec에 공백이 있습니다. laration 부분 (아래 회색 하나의 문자 길이 영역)

v_emphours AIRPLANE. EMPWORKINGHOURS%TYPE;

여기

v_ emphours

그 공백을 제거하고 쓸모 견적을 제거하면 오류없이이 명령을 실행할 수 있습니다 :

create or replace TRIGGER NEWSALARY 
before insert or update on CREW 
for each row 
Declare 
v_emphours AIRPLANE.EMPWORKINGHOURS%TYPE; 
BEGIN 
select EMPWORKINGHOURS into v_emphours from AIRPLANE Where AIRPLANEID =:NEW.AirPlaneID; 
if 
v_emphours > 8 
then 
:NEW.Salary:= :NEW.Salary* 50; 
END IF; 
End;