"SP2-0042: unknown command "end" - rest of line ignored.", When "Create or replace trigger"

Problem

I got an SP2-0042 when running this script

CREATE OR REPLACE /*EDITIONABLE*/ TRIGGER "APEX_EBS_EXTENSION"."DS_RICEW_ATTACHMENTS_BI" 
before insert on apex_ebs_extension.ds_ricew_attachments
for each row
begin
  :new.ricew_attachment_id := apex_ebs_extension.ds_rw_att_att_id_seq.nextval;
end;

Solution

Interestingly, this only happens when run from the command line (SQL Client/Unix).
It doesn't happen in SQLDeveloper - it must filter it out before it parses the command.

I had the "editionable" in comments because that command was generated by apex, and our database didn't like it.

Turns out that this commented out word caused the very confusing message. You can't have any comments in a "create or replace" statement.

Even create ot replace "blahblah" trigger...

Take it out, and it works.

Comments

  1. What change i need to do ? To solve this.

    ReplyDelete
  2. "You can't have any comments in a "create or replace" statement.

    Even create ot replace "blahblah" trigger...

    Take it out, and it works."

    ReplyDelete

Post a Comment