Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ex1a
- DECLARE
- TYPE NomEtudiant IS TABLE OF stud.nume%TYPE;
- MaListe NomEtudiant;
- ListeEt MaListe%Type;
- BEGIN
- ListeEt := NomEtudiant('Maira','Larisa','Francesca','Laura','Elena');
- For i IN ListeEt.FIRST..ListeEt.LAST LOOP
- dbms_output.put_line(' Nome: '||i||' '|| ListeEt(i));
- END LOOP;
- END;
- ex1b
- DECLARE
- TYPE NomEtudiant IS TABLE OF stud.nume%TYPE;
- MaListe NomEtudiant:=NomEtudiant('Maira','Larisa','Francesca','Laura','Elena');
- BEGIN
- MaListe.DELETE(3);
- For i IN 1 .. MaListe.COUNT
- LOOP
- dbms_output.put_line(' Nome: '||i||' '|| MaListe(i));
- END LOOP;
- EXCEPTION
- WHEN OTHERS THEN
- DBMS_OUTPUT.PUT_LINE('Autre exception');
- END;
- /
- ex1c
- Declare
- TYPE NomEtudiant IS TABLE OF stud.nume%TYPE;
- MaListe NomEtudiant;
- i NUMBER;
- begin
- MaListe := NomEtudiant('Maira','Larisa','Francesca','Laura','Elena');
- MaListe.Delete(3);
- i :=MaListe.FIRST;
- LOOP
- DBMS_OUTPUT.PUT_LINE('Etudiant: ' || MaListe(i) );
- i := MaListe.NEXT(i);
- exit when i is null;
- end loop;
- end;
- /
- ex1d
- DECLARE
- i NUMBER;
- TYPE NomEtudiant IS TABLE OF stud.nume%TYPE;
- MaListe NomEtudiant:=NomEtudiant('Maira','Larisa','Francesca','Laura','Elena');
- BEGIN
- MaListe.DELETE(3);
- i := MaListe.FIRST;
- MaListe.extend(3,i);
- LOOP
- dbms_output.put_line(' Nome: '||i||' '|| MaListe(i));
- i:=Maliste.NEXT(i);
- exit when i is null;
- END LOOP;
- end;
- /
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement