compilation unit analysis terminated error when compiling a trigger
DBAsupport.com Forums - Powered by vBulletin
Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: compilation unit analysis terminated error when compiling a trigger

Hybrid View

  1. #1
    Join Date
    Mar 2005
    Posts
    143

    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.

  2. #2
    Join Date
    Jul 2002
    Location
    Lake Worth, FL
    Posts
    1,471

    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

  3. #3
    Join Date
    Mar 2005
    Posts
    143
    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.

  4. #4
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,554
    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.

  5. #5
    Join Date
    Mar 2005
    Posts
    143
    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.

  6. #6
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,554
    Quote Originally Posted by jayjabour View Post
    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.

  7. #7
    Join Date
    Mar 2005
    Posts
    143
    "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.

  8. #8
    Join Date
    Jul 2002
    Location
    Lake Worth, FL
    Posts
    1,471

    Cool 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

  9. #9
    Join Date
    Jul 2002
    Location
    Lake Worth, FL
    Posts
    1,471

    Thumbs down Inclomplete or what?

    AGAIN:
    Quote Originally Posted by LKBrwn_DBA View Post
    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

  10. #10
    Join Date
    Mar 2005
    Posts
    143
    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
  •  



Click Here to Expand Forum to Full Width