db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "tim.wickett" <...@nextech-technology.co.uk>
Subject More trigger problems
Date Sun, 25 Aug 2013 09:40:08 GMT
Hi again, I am having more trigger problems. This time I am trying to create
a history when values are updated. This is my code

CREATE TRIGGER update_location
    AFTER UPDATE ON WASTE_ITEM
    REFERENCING OLD AS old_waste_item
    FOR EACH ROW 
    WHERE (old_waste_item.current_location 
           <> current_location)
    INSERT INTO WASTE_ITEM_LOCATION_HISTORY
    VALUES (old_waste_item.waste_item_id, CURRENT DATE,
            old_waste_item.current_site_id, old_waste_item.current_location)

I get the following syntax error

Error code -1, SQL state 42X01: Syntax error: Encountered "WHERE" at line 4,
column 18.

but as far as I can see the syntax is correct so please help. Hopefully I am
missing something obvious.

Thanks Tim



--
View this message in context: http://apache-database.10148.n7.nabble.com/More-trigger-problems-tp133437.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.

Mime
View raw message