1

I had built a few tables with sequences and triggers, since I need to share the script with my team at uni I did an export with sqldeveloper, now when I try to import/execute the resulted .sql I'm getting errors with triggers. This is the error message:

"Error starting at line 250 in command:
CREATE OR REPLACE EDITIONABLE TRIGGER "TRG_ACCOUNTS" 
BEFORE INSERT ON ACCOUNTS 
FOR EACH ROW 
BEGIN

  SELECT SEQ_ACCOUNTS.NEXTVAL INTO :NEW.ACCOUNT_ID FROM DUAL
Error report:
SQL Command: editionable TRIGGER
Failed: Warning: execution completed with warning

Error starting at line 258 in command:
END
Error report:
Unknown Command
trigger "TRG_ACCOUNTS" altered."

This is the part of the script it's complaining about. I have a few other triggers and it's giving me the same error on all of them. I've checked how the triggers are created after executing the script, and all of them seem to be missing a semi colon and the "END;" at the end.

Example:

create or replace 
TRIGGER "TRG_FL_AR" 
BEFORE INSERT ON FLOOR_AREAS 
FOR EACH ROW 
BEGIN 
SELECT SEQ_FL_AR.NEXTVAL INTO :NEW.FLOOR_AREA_ID FROM DUAL <-- missing ";" here

<missing "END;" here>

Could you please help me?

Thank you.

stigma
  • 338
  • 2
  • 12
  • You don't need the `select` in the first place. `:NEW.FLOOR_AREA_ID := SEQ_FL_AR.NEXTVAL;` is enough –  Nov 10 '15 at 07:22
  • @a_horse_with_no_name Thank you, I'll try this when I get home. I didn't know you could do it that way. I'll give it a try. – stigma Nov 10 '15 at 17:01

1 Answers1

0

Try to put a back slash / after line 258 and check again

Utsav
  • 7,914
  • 2
  • 17
  • 38
  • Actually I removed all the "/", since I read somewhere that this was sqlplus syntax or something like that (can't remember very well) and I was trying to execute the script in sqldeveloper and I was getting all sort of errors including the one I posted :( – stigma Nov 10 '15 at 17:00