2017-12-11 8 views
0

私は私のテーブルのために、このトリガーをコンパイルしようとしていると、私はこのエラーを取得し続ける:Oracle Databaseのコンパイルエラー

エラーメッセージ

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部分(下の灰色の1文字長領域)

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; 
関連する問題