!我在創建一個觸發器,只要我將信息插入到表格中,就可以計算總行數並打印新添加的行。這裏是我的代碼:插入後觸發錯誤
Create or replace trigger TR_everyInsert
After INSERT On PERSONS
For each row
Declare
rowNumber int;
PERSON_NAME varchar(30);
gender varchar(30);
color varchar(30);
Begin
select PERSON_NAME,GENDER,COLOR
From PERSONS
Where PERSON_NAME=:new.PERSON_NAME;
select count(*) as rowNumber
from PERSONS;
if inserting then
DBMS_OUTPUT.PUT_LINE ('There are ' || To_CHAR(rowNumber));
DBMS_OUTPUT.PUT_LINE ('New added info is ' || PERSON_NAME || 'with gender ' ||
GENDER || 'with color ' || color);
end if;
end;
/
但是,我得到編譯錯誤說「進入子句預期」,請問是什麼問題?
非常感謝您的回答。 – 2014-11-20 23:45:17