SHARE
TWEET

Untitled

a guest Dec 3rd, 2019 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ALTER FUNCTION "DBA"."Wolne_samochody"()
  2. RETURNS INTEGER
  3. DETERMINISTIC
  4. BEGIN
  5. DECLARE return_name integer;
  6. DECLARE kursor dynamic scroll cursor for select "DBA"."Samochody"."id_statusu" from Samochody;
  7. DECLARE @statuss integer;
  8. DECLARE @ilosc integer;
  9. DECLARE i int;
  10. SET i=0;
  11. SET @statuss=0;
  12. SET @ilosc=0;
  13. OPEN kursor;
  14. while i < (SELECT count(*) from Samochody)
  15.     LOOP
  16.         SET i=i+1;
  17.         FETCH NEXT kursor INTO @statuss;
  18.         IF (statuss=2)
  19.         THEN
  20.             BEGIN
  21.                 SET @ilosc=@ilosc+1;
  22.             END
  23.         END IF;
  24.     END LOOP;
  25. CLOSE kursor;
  26. set return_name = @ilosc;
  27.     RETURN "return_name";
  28. 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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top