[Sql] colonnes d'une table
bonjour,
j'aimerais avoir de l'aide sur l'affichage des noms de colonnes d'une table lors de l'utilisation de UTL_FILE.
j'arrive à avoir le fichier mais elle est vide quand je l'ouvoir;
voici comment g fais mon code
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
lf$fic UTL_FILE.file_type;
LC$ligne VARchar(32767);
curseur c_curs is
select
column_name,data_type
from users_tab_columns where table_name=ma_table
and data_type in ('NUMBER','VARCHAR');
Begin
fichier:=ouvrir_fichier(lf$fic,lc$ligne)--g prealablement declaré cette fonction--
If pc$col:='O' then
I:=1;
For cols in c_curs loop
If I:=1 then
LC$ligne:= Lc$ligne ||Cols.column_name;
else
LC$ligne :=LC$ligne ||Cols.column_name;
end if;
I:=I+1;
end loop;
UTL_FILE.Put_LINE(LF$FIC,LC$ligne);
Utl_file.Fclose(lf$fic)
end;
/ |