Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

impdp triggers always give error ORA-04071:missing BEFORE, AFTER or INSTEAD

CLUTCH DBASep 20 2010 — edited Sep 20 2010
Hello,

I am using 11g impdp to create a test system.

I use this cmd to import


impdp 'SYS/xxxxx@PWRFUN AS SYSDBA' dumpfile=PWRPROD.DMP logfile=PWRFUNimportPROD.log SCHEMAS=pwrplant TABLE_EXISTS_ACTION=REPLACE





Then I get this error for all the triggers



ORA-39083: Object type TRIGGER failed to create with error:
ORA-04071: missing BEFORE, AFTER or INSTEAD OF keyword
Failing sql is:
CREATE TRIGGER "PWRPLANT"."APPROVAL_STEPS_HISTORY" PS_HISTORY
BEFORE UPDATE OR INSERT ON PWRPLANT.APPROVAL_STEPS_HISTORY
FOR EACH ROW
BEGIN :new.user_id := USER; :new.time_stamp := SYSDATE; END;

As you can see, the trigger does contain the word "before".






When I remove " "PWRPLANT"."APPROVAL_STEPS_HISTORY" " and run the trigger below, it compiles correctly. Why is this, and how do I make my impdp to run correctly?

CREATE TRIGGER PS_HISTORY
BEFORE UPDATE OR INSERT ON PWRPLANT.APPROVAL_STEPS_HISTORY
FOR EACH ROW
BEGIN :new.user_id := USER; :new.time_stamp := SYSDATE; END;
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 18 2010
Added on Sep 20 2010
2 comments
1,197 views