Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2004
    Posts
    3

    Unanswered: Column Not Allowed Error When creating TRIGGER

    I have the following trigger:

    CREATE OR REPLACE TRIGGER employees_del
    BEFORE DELETE ON employee
    FOR EACH ROW
    BEGIN
    INSERT INTO DEL_RECS
    VALUES
    ('EMPLOYEES', CURRENT_TIMESTAMP, TO_CHAR(OLD.ID_NUM));

    END;

    My DEL_RECS table was defined as follow:

    CREATE TABLE DEL_RECS
    (
    table_nm varchar(11) not null,
    ts timestamp not null,
    Key_string varchar2(256) not null
    )

    Employee has D_NUM as Number.

    This trigger has status Invalid when I compile it. I got an error ORA 00984 COLUMN NOT ALLOWED. When I replace TO_CHAR(OLD.ID_NUM) with a string like "hey", it compiles successfully.

    I'm using PL/SQL to create the trigger.

    Thanks.

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Just change OLD.ID_NUM with :OLD.ID_NUM and everything will be OK.

Posting Permissions

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