5 Replies Latest reply: Mar 6, 2013 3:34 AM by SuhasBagade RSS

    How to compare the value of a binding variable with a string "HOLD" ......?

    SuhasBagade
      Hi All,

      I have two tables - TABLE1 & TABLE2 and both the tables are having STATUS column. The requirement is like if the STATUS column of TABLE1 is updated as "HOLD" then the same value has to be updated to the STATUS column of TABLE2.


      create or replace trigger "TEST_TRG"
      BEFORE
      update of "STATUS" on "TABLE1"
      for each row
      begin
      if(:new.STATUS ='HOLD')then
      {
      insert into TABLE2 (STATUS)
      value (:new.STATUS);

      }
      end if;
      end;


      COMPILATION ERROR:
      Compilation failed, line 3 (02:40:14) The line numbers associated with compilation errors are relative to the first BEGIN statement. This only affects the compilation of database triggers.
      PLS-00103: Encountered the symbol "{" when expecting one of the following: ( 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> << continue close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe purge The symbol "{" was ignored. Compilation failed, line 7 (02:40:14) The line numbers associated with compilation errors are relative to the first BEGIN statement. This only affects the compilation of database triggers.
      PLS-00103: Encountered the symbol "}" when expecting one of the following: ( begin case declare else elsif end 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 The symbol "}" was ignored.




      I am getting the compilation errors as above when the trigger is compiled. Can anyone please help me to correct it.


      Thanks and Regards,
      Suhas