SHARE
TWEET

Untitled

a guest Dec 3rd, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ALTER PROCEDURE "DBA"."Dodaj_naprawe"(in nr_rejj VARCHAR(30), in rodzajj VARCHAR(30), in opiss VARCHAR(30))
  2. BEGIN
  3.     DECLARE idd int;
  4.     SET idd=1;
  5.     WHILE((SELECT naprawy.id_naprawy FROM naprawy)=idd)
  6.         BEGIN
  7.             SET idd=idd+1;
  8.         END;
  9.  
  10.     IF EXISTS(SELECT Samochody.nr_rejestracyjny FROM Samochody WHERE nr_rejestracyjny=nr_rejj)
  11.     THEN        
  12.         BEGIN
  13.             INSERT INTO Naprawy VALUES(idd, nr_rejj, rodzajj, opiss);
  14.         END
  15.     ELSE
  16.         BEGIN
  17.             RAISERROR 99999 'Nie ma takiego samochodu'
  18.         END
  19.     END IF;
  20. 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