ORA-00904: "ACTION": invalid identifier

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • viny2cool
    New Member
    • Dec 2009
    • 4

    ORA-00904: "ACTION": invalid identifier

    Hey guys I am trying to create an trigger, but getting this error. My code is as follows
    Code:
    CREATE OR REPLACE TRIGGER vendorpricingTR
    BEFORE UPDATE OF pricing ON vendors
    FOR EACH ROW
    DECLARE 
    ActionVar char(6);
    BEGIN
    
    IF UPDATING THEN
    ActionVar :=’UPDATE’;
    END IF;
    INSERT into VENDORS
    (vendorsname,addr,pricing,ratings, Action)
    VALUES (:old.vendorsname, :old.addr, :new.pricing,  :old.ratings, Actionvar);
    
    END;
    error is

    LINE/COL ERROR
    -------- -----------------------------------------------------------------
    8/1 PL/SQL: SQL Statement ignored
    9/36 PL/SQL: ORA-00904: "ACTION": invalid identifier
    Last edited by debasisdas; Dec 14 '09, 10:52 AM. Reason: formatted using code tags.
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Is action a field in your table ?

    Comment

    • viny2cool
      New Member
      • Dec 2009
      • 4

      #3
      Action is a new column I want to insert in the table.......... .....

      Comment

      • amitpatel66
        Recognized Expert Top Contributor
        • Mar 2007
        • 2358

        #4
        Can you please post the output of the below command here for reference:

        [code=oracle]

        SQL> desc VENDORS

        [/code]

        Comment

        • debasisdas
          Recognized Expert Expert
          • Dec 2006
          • 8119

          #5
          the column must exist in the table to insert the value into it.

          Comment

          • Saii
            Recognized Expert New Member
            • Apr 2007
            • 145

            #6
            Re-check your trigger code for following
            1. There are no :old values when inserting to a table.
            2. This is row level trigger, you need to store the values of the row to use it later.

            Comment

            • dbcodeerror
              New Member
              • Dec 2009
              • 1

              #7
              Hi,

              This oracle error Action is : Enter a valid column name. A valid column name must begin with a letter, be less than or equal to 30 characters, and consist of only alphanumeric characters and the special characters $, _, and #. If it contains other characters, then it must be enclosed in double quotation marks. It may not be a reserved word.

              Source : http://www.dbcodeerror.com/oracle-da...id-identifier/

              Comment

              Working...