-
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
-
Inclomplete or what?
AGAIN:
Originally Posted by LKBrwn_DBA
You are not posting all the error messages, are you?
The error you posted is not an isolated error but it complements other error messages.
POST ALL the error messsages...
"The person who says it cannot be done should not interrupt the person doing it." --Chinese Proverb
-
I appologize looks like there was another part to the error. here is the entire thing. Sorry but this is all i get.
PL/SQL: ORA-06552: PL/SQL: Compilation unit analysis terminated
ORA-06553: PLS-320: the declaration of the type of this expression is incomplete or malformed
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
|