Changes between Version 62 and Version 63 of AdvancedApplicationDevelopment


Ignore:
Timestamp:
08/31/24 02:08:58 (3 months ago)
Author:
184006
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AdvancedApplicationDevelopment

    v62 v63  
    8383EXECUTE FUNCTION set_default_date_askes();
    8484}}}
     85\\ При внес на date_added во Products автоматски се пополнува денешниот датум.
     86{{{
     87CREATE OR REPLACE FUNCTION set_date_added()
     88RETURNS TRIGGER AS $$
     89BEGIN
     90    -- Поставување на dateAdded на тековниот датум
     91    NEW.dateAdded := CURRENT_DATE;
     92    RETURN NEW;
     93END;
     94$$ LANGUAGE plpgsql;
     95
     96CREATE TRIGGER before_insert_set_date_added
     97BEFORE INSERT ON products
     98FOR EACH ROW
     99EXECUTE FUNCTION set_date_added();
     100}}}