#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2007
    Posts
    39
    Rep Power
    8

    Trigger Problem On Firebird 2.5


    Hi all,
    please help me about this syntax on trigger

    i have 2 table ,table1,table2



    then create trigger on table1

    Code:
    SET TERM ^ ;
    
    CREATE TRIGGER TRIGGERNAME FOR TABLE1
    ACTIVE BEFORE DELETE POSITION 0
    AS
    BEGIN
      /* Trigger text */
     
      UPDATE TABLE2 SET STATUS=0 WHERE   TABLE2.ID=TABLE1.IDTABLE2;
    END^
    
    SET TERM ; ^
    what i want is everytime i delete row on TABLE1
    the trigger will update TABLE2 STATUS=0 base on
    TABLE1.IDTABLE2 column

    but it show error:
    Engine Error (code = 335544569):
    Dynamic SQL Error.
    SQL error code = -206.
    Column unknown.
    TABLE1.IDTABLE2.

    on previous version it work.
    pls give me solution,thx
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2006
    Location
    Plovdiv. Bulgaria
    Posts
    226
    Rep Power
    12
    Code:
    CREATE TRIGGER TRIGGERNAME FOR TABLE1 
    ACTIVE BEFORE DELETE POSITION 0 
    AS 
    BEGIN   
    /* Trigger text */     
        UPDATE TABLE2 SET 
            STATUS=0 
        WHERE   
            TABLE2.ID=OLD.IDTABLE2; 
    END

IMN logo majestic logo threadwatch logo seochat tools logo