0
create or replace TRIGGER "CARAVAN"
    before insert or update ON caravan
        FOR EACH ROW DECLARE cara_no number;
            BEGIN
                if inserting then
                    if :new.caravan_no is null then
                       select caravan.nextval into cara_no from dual;   
                       :new.caravan := cara_no;
                    end if;
                    if :new.tags is not null then
                       :new.tags := caravan_new.tags_cleaner(:new.tags);
                    end if;
                end if;
                caravan_new.tag_sync(
                    p_new_tags => :new.tags,
                    p_old_tags => :old.tags,
                    p_content_type => 'CUSTOMER',
                    p_content_id => :new.caravan_no );
            END;

These are the two errors with my code

ORA-24344: success with compilation error   



PLS-00103: Encountered the symbol "CREATE" 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> 
Ryan Vincent
  • 4,483
  • 7
  • 22
  • 31
AHMER93
  • 35
  • 5
  • And this error is? Plus, at least take some time to format this properly. Right now it's basically unreadable junk. – Marc B Jan 08 '16 at 15:40
  • Also: http://stackoverflow.com/questions/11321491/when-to-use-single-quotes-double-quotes-and-backticks – Marc B Jan 08 '16 at 15:47
  • how would i change the code for it to be correct – AHMER93 Jan 08 '16 at 16:09
  • ORA-24344: success with compilation error – AHMER93 Jan 08 '16 at 16:12
  • PLS-00103: Encountered the symbol "CREATE" when expecting one of the following: ( begin case declare exit for goto if loop mod null pragma raise return select update while with – AHMER93 Jan 08 '16 at 16:13
  • Im sorry i don't know how to use the site 100% – AHMER93 Jan 08 '16 at 16:23
  • Unrelated, but: the sequence handling can be simplified to `:new.caravan := caravan.nextval` –  Jan 08 '16 at 16:43
  • 1
    Which tool do you use to run this statement? Is that the only statement you are running? Typically you need a `/` after a PL/SQL block to make it work. –  Jan 08 '16 at 16:43
  • through sql workshop but i still cant get it to work, it comes up with the same error message can someone change the code and make it correct – AHMER93 Jan 08 '16 at 16:46

0 Answers0