下面是我写的一个触发器语句,用JDBC的Statement.execute(sqlStripped);
CREATE OR REPLACE trigger HELP_TRIGGER
  after insert or delete or update on HELP for each row
begin
  if inserting then
    insert into HELP_TRS_TEMP values(:new.SEQ,1,SYSDATE);
  elsif deleting then
    insert into HELP_TRS_TEMP values(:old.SEQ,3,SYSDATE);
  elsif updating then
    insert into HELP_TRS_TEMP values(:new.SEQ,3,SYSDATE);
    insert into HELP_TRS_TEMP values(:new.SEQ,1,SYSDATE);
  end if;
end HELP_TRIGGER;建的触发器报错:
Compilation errors for TRIGGER SYSTEM.HELP_TRIGGERError: PLS-00103: 出现符号 ""在需要下列之一时:
        begin case declare exit for
          goto if loop mod null pragma raise return select update while
          with <an identifier> <a double-quoted delimited-identifier>
          <a bind variable> << close current delete fetch lock insert
          open rollback savepoint set sql execute commit forall merge
          pipe
Line: 3
Text: begin

解决方案 »

  1.   

    sql 块本身没有任何问题!!
    建议:
    1.不要把对象建到system用户下。
    2。可能是你的sql字符串在java中拼接出错。试着在执行前,把sql先打印出来看看,估计有问题。
      

  2.   

    自建一个用户,然后在其中进行测试学习:
    create tablespace ...;
    create user...;
      

  3.   

    把触发器在数据库里调试吧,最好不要用应用程序来实现。避免出错。
    如果要那样的话最好用CallableStatement