SHARE
TWEET

Untitled

a guest Apr 18th, 2019 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- wypełnianie tabeli danymi
  2. DECLARE
  3.     CURSOR c1 IS SELECT id_student, nazwisko, imie
  4.         FROM studenci ;
  5.     CURSOR c2 IS SELECT id_osrodek, nazwa_o
  6.         FROM osrodki ;
  7.     vx NUMBER;
  8.     i NUMBER;
  9.     vCourseColl StudCourseCollection ;
  10. BEGIN
  11.     FOR vc1 IN c1 LOOP
  12.         vCourseColl := StudCourseCollection() ;
  13.         i := 1 ;
  14.         FOR vc2 IN c2 LOOP
  15.         SELECT COUNT(NR_EGZ) INTO vx FROM EGZAMINY e
  16.         WHERE e.id_student = vc1.id_student
  17.         AND e.id_osrodek = vc2.id_osrodek;
  18.         DBMS_OUTPUT.PUT_LINE(vc1.id_student || ' ' || vc2.id_osrodek || ' ' || vx);
  19.             vCourseColl.extend ;
  20.             vCourseColl(i):= StudCourseCredits(vc2.id_osrodek, vc2.nazwa_o, vx) ;
  21.             i := i+1 ;
  22.         END LOOP ;
  23.         INSERT INTO Indeks VALUES (vc1.id_student, vc1.imie, vc1.nazwisko, vCourseColl) ;
  24.     END LOOP ;
  25. 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