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

  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,492

    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,555
    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,555
    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,492

    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
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,555
    Quote Originally Posted by jayjabour View Post
    "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.

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


Click Here to Expand Forum to Full Width