-
compilation unit analysis terminated error when compiling a trigger
I created a trigger to execute when someone inserts a row into a table. when I went to compile the trigger after creating it I get the following error:
PL/SQL: ORA-06552: PL/SQL: Compilation unit analysis terminated
It is pointing to line 6. here is the trigger:
DROP TRIGGER AXIUM.PICTURETRG;
CREATE OR REPLACE TRIGGER AXIUM.PICTURETRG
AFTER INSERT
ON AXIUM.PICTURE REFERENCING NEW AS NEW
FOR EACH ROW
DECLARE
vOsUser VARCHAR2(64);
BEGIN
select SYS_CONTEXT('USERENV','OS_USER') into vOsUser from dual;
INSERT INTO AXIUM.PICTUREAUD VALUES (
:NEW."Patient",
vOsUser,
sysdate);
END;
/
Any help would be greatly appreciated. Thank you.
-
Bad syntax.
1) It is not necesary to DROP the trigger if you have a "CREATE OR REPLACE..."
2) You cannot do DML on the same table of the trigger.
"The person who says it cannot be done should not interrupt the person doing it." --Chinese Proverb
-
Thank you for the quick responce. I will get rid of the drop. however I am not doing a DML on the same table as the trigger. The trigger is executing after an insert on the PICTURE table and it is inserting into the PICTUREAUD table.
-
It would help if post provides full session log.
Either way, please try...
vOsUser := USERENV('OS_USER');
... instead of...
select SYS_CONTEXT('USERENV','OS_USER') into vOsUser from dual;
Pablo (Paul) Berzukov
Author of Understanding Database Administration available at amazon and other bookstores.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
-
PAVB,
I tried repolacing the line of code you mentioned with your suggestion and went to compile it again and got the same error. I can provide a session log if someone lets me know how to do that.
-
Originally Posted by jayjabour
I can provide a session log if someone lets me know how to do that.
For short logs use copy/paste - for long ones use Attach feature, "Go Advanced" and click on attach button.
Pablo (Paul) Berzukov
Author of Understanding Database Administration available at amazon and other bookstores.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
-
"For short logs use copy/paste - for long ones use Attach feature, "Go Advanced" and click on attach button." I am not sure what utility you are using that has those options.
-
Incompleteness...
You are not posting all the error messages, are you?
"The person who says it cannot be done should not interrupt the person doing it." --Chinese Proverb
-
Originally Posted by jayjabour
"For short logs use copy/paste - for long ones use Attach feature, "Go Advanced" and click on attach button." I am not sure what utility you are using that has those options.
are you referring to copy/paste?
on the other hand "Go Advanced" is the nice button on the bottom-right of the screen you use to post
Pablo (Paul) Berzukov
Author of Understanding Database Administration available at amazon and other bookstores.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
-
OK, I guess we are not talking about the same thing. My mistake sorry. When I asked someone to tell me how to supply a session log I ment how to I get a session log. once I get the log I now how to attach it or copy and paste What I am not sure on is other then spooling my session to a file how would I get you a session log?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|