Advertisement
Guest User

Untitled

a guest
Mar 28th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. ex1a
  2. DECLARE
  3. TYPE NomEtudiant IS TABLE OF stud.nume%TYPE;
  4. MaListe NomEtudiant;
  5. ListeEt MaListe%Type;
  6. BEGIN
  7. ListeEt := NomEtudiant('Maira','Larisa','Francesca','Laura','Elena');
  8. For i IN ListeEt.FIRST..ListeEt.LAST LOOP
  9. dbms_output.put_line(' Nome: '||i||' '|| ListeEt(i));
  10. END LOOP;
  11. END;
  12.  
  13.  
  14. ex1b
  15. DECLARE
  16. TYPE NomEtudiant IS TABLE OF stud.nume%TYPE;
  17. MaListe NomEtudiant:=NomEtudiant('Maira','Larisa','Francesca','Laura','Elena');
  18. BEGIN
  19. MaListe.DELETE(3);
  20. For i IN 1 .. MaListe.COUNT
  21. LOOP
  22. dbms_output.put_line(' Nome: '||i||' '|| MaListe(i));
  23. END LOOP;
  24. EXCEPTION
  25. WHEN OTHERS THEN
  26. DBMS_OUTPUT.PUT_LINE('Autre exception');
  27. END;
  28. /
  29.  
  30.  
  31.  
  32. ex1c
  33. Declare
  34. TYPE NomEtudiant IS TABLE OF stud.nume%TYPE;
  35. MaListe NomEtudiant;
  36. i NUMBER;
  37. begin
  38. MaListe := NomEtudiant('Maira','Larisa','Francesca','Laura','Elena');
  39. MaListe.Delete(3);
  40. i :=MaListe.FIRST;
  41. LOOP
  42. DBMS_OUTPUT.PUT_LINE('Etudiant: ' || MaListe(i) );
  43. i := MaListe.NEXT(i);
  44. exit when i is null;
  45. end loop;
  46. end;
  47. /
  48.  
  49.  
  50. ex1d
  51. DECLARE
  52. i NUMBER;
  53. TYPE NomEtudiant IS TABLE OF stud.nume%TYPE;
  54. MaListe NomEtudiant:=NomEtudiant('Maira','Larisa','Francesca','Laura','Elena');
  55. BEGIN
  56. MaListe.DELETE(3);
  57. i := MaListe.FIRST;
  58. MaListe.extend(3,i);
  59. LOOP
  60. dbms_output.put_line(' Nome: '||i||' '|| MaListe(i));
  61. i:=Maliste.NEXT(i);
  62. exit when i is null;
  63. END LOOP;
  64. end;
  65. /
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement