daily pastebin goal
86%
SHARE
TWEET

Untitled

telsafilm Feb 22nd, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Create trigger betrag
  2. after insert on Ticket
  3. begin
  4.     insert into Ticket_kostet_Betrag(NEW.ID, 'Grundbetrag')
  5. end;
  6.  
  7.  
  8. create trigger betragKinderticket
  9. after insert on Ticket
  10. when exists (
  11.     select *
  12.     from Ticket
  13.     where ID = NEW.ID
  14.     and Kinderticket = TRUE
  15. )
  16. begin
  17.     insert into Ticket_kostet_Betrag values (NEW.ID, 'Kinderticket')
  18. end;
  19. end;
  20.  
  21.  
  22. create trigger betragDreiD
  23. before insert on Ticket
  24. when exists(
  25.     select *
  26.     from Vorstellung
  27.     where ID = New.ID
  28.     and DreiD = TRUE
  29. )
  30. begin
  31.     insert into Ticket_kostet_Betrag values (NEW.ID, '3D')
  32. end;
  33. end;
  34.  
  35.  
  36. create trigger betragUeberlaenge
  37. before insert on Ticket
  38. when exists (
  39.     select *
  40.     from Film f, Vorstellung v
  41.     where v.FilmID = f.ID
  42.     and v.ID = NEW.ID
  43.     and f.Spiellaenge > 120
  44. )
  45. begin
  46.     insert into Ticket_kostet_Betrag values (NEW.ID, 'Ueberlaenge')
  47. end;
  48. end;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top