Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2007
    Posts
    2

    Unanswered: Trigger Problem(PLS-00049)

    Hi guys!

    I'm getting a PLS-00049 error when I try to implement the following trigger:

    Error Msg:

    PLS-00049: bad bind variable 'PROCESSED'


    Trigger:

    CREATE OR REPLACE TRIGGER my_Trigger
    AFTER UPDATE ON mytable
    REFERENCING NEW AS NEW OLD AS OLD
    FOR EACH ROW

    BEGIN
    IF (NEW:PROCESSED = 0) THEN
    DELETE FROM table1 WHERE id = NEW:ID;
    END IF;
    END;


    I will really appreciate any help on this regard.


    shidalgo

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    not
    >NEW:PROCESSED
    but
    :NEW.PROCESSED
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Dec 2007
    Posts
    2

    Trigger Problem(PLS-00049)

    Quote Originally Posted by anacedent
    not
    >NEW:PROCESSED
    but
    :NEW.PROCESSED
    ----------

    thanks for the clarification;


    shidalgo

  4. #4
    Join Date
    Dec 2007
    Location
    India
    Posts
    5

    May I help You

    Hi ,
    I think you have ommitted a comma between NEW AS NEW and OLD AS OLD . Just rectify the error by giving a comma in between them and see if the problem is sorted out .
    Regards ,
    Experts .

    Quote Originally Posted by shidalgo
    Hi guys!

    I'm getting a PLS-00049 error when I try to implement the following trigger:

    Error Msg:

    PLS-00049: bad bind variable 'PROCESSED'


    Trigger:

    CREATE OR REPLACE TRIGGER my_Trigger
    AFTER UPDATE ON mytable
    REFERENCING NEW AS NEW OLD AS OLD
    FOR EACH ROW

    BEGIN
    IF (NEW:PROCESSED = 0) THEN
    DELETE FROM table1 WHERE id = NEW:ID;
    END IF;
    END;


    I will really appreciate any help on this regard.


    shidalgo

  5. #5
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Not really, Expert; your suggestion is wrong:
    Code:
    SQL> create or replace trigger trg_expert
      2    after update on dept
      3    referencing new as new, old as old
      4    for each row
      5  begin
      6    null;
      7  end;
      8  /
      referencing new as new, old as old
                            *
    ERROR at line 3:
    ORA-04079: invalid trigger specification
    
    
    SQL>
    Read more about CREATE TRIGGER statement, or even the Coding Triggers chapter of the "Application Developer's Guide - Fundamentals" book.

Posting Permissions

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