Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2001
    Posts
    21

    Unanswered: Oracle 9i - "ORA-04076: invalid NEW or OLD specification"

    I'm trying to create a new trigger on a table and am getting

    ORA-04076: invalid NEW or OLD specification

    Using 9.2.0.2.

    Here is the code:

    Code:
    CREATE OR REPLACE TRIGGER BEN.UNIQUE_PAIR
    BEFORE INSERT
    ON BEN.EDGES 
    referencing new as newrow
    FOR EACH ROW
    WHEN (
     check_unique_pair(newrow.A, newrow.B)  >= 1
    )
    BEGIN raise_application_error(-200000,"Attempt to add duplicate row, soft error, ignore and continue");
    END;
    /
    The bolded line is the one causing the problem. What am I doing wrong?

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Try ":newrow" instead of "newrow".

    By the way, what's wrong with "new"? Why "newrow"?

    Also, -200000 is out of range (i.e. is too large). Check documentation how to correctly set it (pay attention to values reserved for you, as a developer).

    Furthermore, you do NOT enclose string into double quotes, but single ones.

    Fix these errors and say if it still doesn't work.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •