Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --EXERCICE 4--
- ACCEPT Var1 PROMPT 'Entre un code de matière' ;
- SET SERVEROUTPUT ON ;
- DECLARE
- CURSOR modules IS
- (SELECT Libelle
- FROM MODULE
- CONNECT BY PRIOR Codepere = Code
- START WITH Code = '&Var1');
- Var2 VARCHAR(500);
- BEGIN
- FOR VarCur IN modules LOOP
- Var2:= Var2 || VarCur.Libelle || '/';
- END LOOP;
- DBMS_OUTPUT.PUT_LINE (Var2);
- END;
- --EXERCICE 5--
- ACCEPT NomTable PROMPT 'Entre le nom de la table';
- DECLARE
- CURSOR attributs IS
- (SELECT Column_Name
- FROM User_Tab_Columns
- WHERE TABLE_NAME = '&NomTable');
- Attributs VARCHAR2 (10000);
- BEGIN
- Attributs := '&NomTable' || '(';
- FOR Var3 IN attributs LOOP
- Attributs:= Attributs || Var3.Column_Name || ',';
- END LOOP;
- Attributs := Attributs || ')';
- DBMS_OUTPUT.PUT_LINE (Attributs);
- END;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement