Dba TP1
Dba TP1
OBJECT_TYPE COUNT(*)
------------------- ----------
SEQUENCE 3
PROCEDURE 2
TRIGGER 2
TABLE 7
INDEX 19
VIEW 1
OBJECT_TYPE COUNT(*)
------------------- ----------
INDEX 19
PROCEDURE 2
SEQUENCE 3
TABLE 7
TRIGGER 2
VIEW 1
34
OWNER COUNT(*)
------------------------------ ----------
MDSYS 28
FLOWS_020100 7
CTXSYS 3
HR 7
SYSTEM 5
SYS 12
end;
/
SQL> set serveroutput on
SQL> execute affich_table
1REGIONS
2LOCATIONS
3DEPARTMENTS
4JOBS
5EMPLOYEES
6JOB_HISTORY
7COUNTRIES
cursor ca (x user_tab_columns.table_name%type) is
select column_name from user_tab_columns
where table_name = x;
ch varchar2(1000);
begin
for vct in ct loop
ch := vct.table_name ||' (';
for vca in ca(vct.table_name) loop
if ca%rowcount = 1
then
ch := ch || vca.column_name;
else
ch := ch ||', '|| vca.column_name;
end if;
end loop;
ch := ch ||')';
dbms_output.put_line(ch);
end loop;
end;
/
--------------------
cursor ca (x dba_tab_columns.table_name%type) is
select column_name from dba_tab_columns
where table_name = x and owner =upper(nom);
ch varchar2(1000);
begin
for vct in ct loop
ch := vct.table_name ||' (';
for vca in ca(vct.table_name) loop
if ca%rowcount = 1
then
ch := ch || vca.column_name;
else
ch := ch ||', '|| vca.column_name;
end if;
end loop;
ch := ch ||')';
dbms_output.put_line(ch);
end loop;
end;
/
COUNT(*)
----------
1089
COUNT(*)
----------
1089
COUNT(*)
----------
669