1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
| voici le code
procedure informationsColonnes(t_name in varchar2) is
cursor list is select column_name,data_type,num_distinct,num_nulls from user_tab_columns where table_name like t_name;
cols list%rowtype;
MIN number;
MAX number;
stdev number;
var number;
med number;
stats number;
avge number;
begin
-- insertion des lignes de colonnes de la table
open list;
loop
fetch list into cols;
insert into informations_Colonnes(col_name,type,nbr_null,nbr_dist) values(cols.column_name,cols.data_type,cols.num_nulls,cols.num_distinct);
if ( (cols.data_type like'%NUMBER%') or (cols.data_type like'%DATE%') ) then
--select min(cols.column_name) into MIN from user_tab_columns u where u.column_name like cols.column_name;
--select max(cols.column_name) into MAX from user_tab_columns u where u.column_name like cols.column_name;
select STDDEV(cols.column_name) into stdev from user_tab_columns u where u.column_name like cols.column_name;
select variance(cols.column_name) into var from user_tab_columns u where u.column_name like cols.column_name;
select median(cols.column_name) into med from user_tab_columns u where u.column_name like cols.column_name;
select stats_mode(cols.column_name) into stats from user_tab_columns u where u.column_name like cols.column_name; |
Partager