daily pastebin goal
17%
SHARE
TWEET

Untitled

a guest Jan 12th, 2018 210 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CREATE OR REPLACE TRIGGER GESCHENK
  2. BEFORE INSERT ON Kunde
  3. for each row
  4. WHEN (new.geburtsdatum ='25.03.1996')
  5. DECLARE CURSOR freecursor
  6.     IS SELECT Artikel.IDArtikel, getraenkemarkt_artikel.IDGetraenkemarkt from Artikel, getraenkemarkt_artikel
  7. WHERE
  8. Artikel.IDArtikel = getraenkemarkt_artikel.IDArtikel AND Artikel.Preis <=2.70 AND
  9. getraenkemarkt_artikel.IDGetraenkemarkt = 2 AND getraenkemarkt_artikel.Anzahl >0;
  10.  
  11.  
  12. BEGIN
  13. FOR k in freecursor LOOP
  14.     INSERT INTO WARENKORB (idKunde, idArtikel, idGetraenkemarkt, anzahl)
  15.     VALUES(:new.IDKunde, k.IDArtikel, k.IDGetraenkemarkt,1);
  16. END LOOP;
  17. END;
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33. insert into kunde
  34. values (50,'name','Herr','massaka','crew','25.03.1996','wiehagen','Gelsenkirchen',
  35. 45879,0209228,'alper333@web.de',546554,454555,'Sparkasse');
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