Advertisement
Guest User

Untitled

a guest
Jan 13th, 2020
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. create or replace FUNCTION creer_exemplaires_livre() RETURNS TRIGGER AS
  2.  
  3. $$
  4.  
  5.     BEGIN
  6.  
  7.         INSERT INTO exemplaire (idlivre) VALUES (new.idlivre);
  8.         INSERT INTO exemplaire (idlivre) VALUES (new.idlivre);
  9.         INSERT INTO exemplaire (idlivre) VALUES (new.idlivre);
  10.  
  11.         RETURN NEW;
  12.     END;
  13. $$
  14.  
  15. LANGUAGE 'plpgsql';
  16.  
  17.  
  18. create TRIGGER trig_after_ins_livre AFTER INSERT ON livre
  19.     FOR EACH ROW
  20. EXECUTE PROCEDURE creer_exemplaires_livre();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement