PLS-00103:遇到符号“文件结束”

时间:2015-11-06 00:11:23

标签: sql oracle plsql triggers

只是尝试在oracle SQL中创建一个简单的触发器,以便在插入表中的行时更新或删除数据。但是我想出了一个错误。

这是我的代码

create or replace trigger "APP_LOG_INSERT"
BEFORE
insert on "APPLICATIONS"
for each row
begin
INSERT INTO APP_LOG (APPLICATION_ID, SRN, APPLICATION_STATUS)
SELECT APPLICATION_ID, SRN, STATUS_ID
FROM INSERTED
end;

我得到的错误是

PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following: (
begin case declare end exception exit for goto if loop mod null pragma raise return select
update while with <an identifier> <a double-quoted delimited-identifier> <a bind variable>
<< continue close current delete fetch lock insert open rollback savepoint set sql execute
 commit forall merge pipe purge`

任何帮助都会非常感激,我对oracle很新,所以我可能只是忽略了一些简单的事情

1 个答案:

答案 0 :(得分:1)

据推测,你想要这样的东西:

create or replace trigger "APP_LOG_INSERT"
BEFORE insert on "APPLICATIONS"
for each row
begin
    INSERT INTO APP_LOG(APPLICATION_ID, SRN, APPLICATION_STATUS)
        SELECT :new.APPLICATION_ID, :new.SRN, :new.STATUS_ID
        FROM dual;
end;