Advertisement
Guest User

Untitled

a guest
Nov 20th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PL/SQL 0.64 KB | None | 0 0
  1. DECLARE
  2. TYPE Typ_Rec_Osr IS RECORD
  3. (Id Osrodki.Id_osrodek%TYPE,
  4. Nazwa Osrodki.Nazwa_o%TYPE) ;
  5. TYPE NT_Osrodki IS TABLE OF Typ_Rec_Osr ;
  6. VT_Osrodki NT_Osrodki := NT_Osrodki();
  7. i NUMBER := 0 ;
  8. CURSOR c_Osrodki IS SELECT Id_osrodek, Nazwa_o FROM Osrodki ;
  9. BEGIN
  10. FOR v_Rec_Osr IN c_Osrodki LOOP
  11. i := c_Osrodki%ROWCOUNT ;
  12. VT_Osrodki.EXTEND ;
  13. VT_Osrodki(i) := v_rec_Osr ;
  14. DBMS_OUTPUT.Put_Line(VT_Osrodki(i).Id || ' ' || VT_Osrodki(i).Nazwa) ;
  15. END LOOP ;
  16. DBMS_OUTPUT.put_line('Tabela zagnieżdżona zawiera ' || VT_Osrodki.LAST || ' elementów');
  17. EXCEPTION
  18. WHEN SUBSCRIPT_BEYOND_COUNT THEN
  19. DBMS_OUTPUT.Put_Line ('Licznik poza zakresem') ;
  20. END;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement