Guest User

Untitled

a guest
Jun 21st, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. CREATE OR REPLACE FUNCTION cleanNoteEventConnections() RETURNS TRIGGER AS $$
  2. DECLARE
  3. BEGIN
  4. EXECUTE 'update invoice set "noteEvent"=null where "noteEvent"=' || OLD.id;
  5. RETURN NULL;
  6. END;
  7. $$ LANGUAGE 'plpgsql';
  8.  
  9. CREATE TRIGGER cleanNoteEventConnections BEFORE DELETE ON note_event
  10. FOR EACH ROW EXECUTE PROCEDURE cleanNoteEventConnections();
Add Comment
Please, Sign In to add comment