Skip to Main Content

Oracle Database Discussions

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!

Encountering error in trigger compilation

Raja2900Jun 29 2017 — edited Jun 30 2017

I have imported full database from 10g to 11g. However  i am not able to compile Triggers, function & procedure. For triggers i m getting the following error(ORA-00942). Also i am providing the trigger script too.

Please guide me as i have not much of experience.

Error:

Line                  ColumnError
8                          57PL/SQL: ORA-00942: table or view does not exist

DROP TRIGGER PRDB_PM.INS_B_ADCO_ADAPT;

CREATE OR REPLACE TRIGGER PRDB_PM.INS_B_ADCO_ADAPT

BEFORE INSERT ON prdb_pm.ADCO_ADAPT FOR EACH ROW

DECLARE

    programm         VARCHAR(120);

    user             VARCHAR(30);

    session_id         NUMBER;--This is line8

BEGIN

    SELECT userenv('SESSIONID') INTO session_id FROM dual;

    BEGIN

        SELECT program,username INTO programm,user FROM V$SESSION

        WHERE audsid = session_id;

        EXCEPTION

        WHEN NO_DATA_FOUND THEN

            programm := 'UNKNOWN';

            user := 'UNKNOWN';

        WHEN OTHERS THEN

            IF (session_id = 0) THEN

                programm := 'JOB';

            ELSE

                programm := 'UNKNOWN';

            END IF;

    END;

    :new.toc := sysdate;

    :new.tom := sysdate;

    :new.mop := substr( programm ,1 ,60);

END;

/

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 28 2017
Added on Jun 29 2017
10 comments
2,043 views