source: database/Advanced Database Developement/Triggers/Automatic setting of the last modified date for orders.txt@ 62b2964

finki-main main
Last change on this file since 62b2964 was 62b2964, checked in by Klimentina Efremova <klimentina08642@…>, 2 weeks ago

Project Handcraft Marketplace

  • Property mode set to 100644
File size: 307 bytes
RevLine 
[62b2964]1CREATE OR REPLACE FUNCTION update_order_modified_date()
2RETURNS TRIGGER
3LANGUAGE plpgsql
4AS $$
5BEGIN
6 NEW.last_modified_date := CURRENT_TIMESTAMP;
7 RETURN NEW;
8END;
9$$;
10
11CREATE TRIGGER trg_update_order_modified_date
12BEFORE UPDATE
13ON "order"
14FOR EACH ROW
15EXECUTE FUNCTION update_order_modified_date();
Note: See TracBrowser for help on using the repository browser.