I need to list tables, columns and their data type; I used this code:
select TABLE_NAME, COLUMN_NAME, DATA_TYPE
from dba_tab_columns
order by TABLE_NAME;
The problem is that the database is too large and I only need 2000 specific table/column/datatype. Knowing that a table with the same name and column can be present in multiple SCHEMA
For example (I have 2000 lines like that table names are very random and have nothing in common so is the case for the column names):
TABLE Column SCHEMA
------------------------------------------
DMT_AAAAAAA C1111 ANT_A1
DMT_AAAAAAA C1111 ANT_A2
BBBBBBBB A4444 ANT_A3
JHD6365 H5525 ZUGRU
WRK679 C3020 MUSTSU
TDG5378 C66739 SHGUY
I tried to filter by schema using this query :
select TABLE_NAME, COLUMN_NAME, DATA_TYPE
from dba_tab_columns
where OWNER in ('ANT_A1', 'ANT_A2', 'ANT_A1', 'ZUGRU', 'MUSTSU', 'SHGUY')
order by TABLE_NAME;
The issue now is that it lists all columns even the ones I don't need.
Is there a way to filter out only the lines needed?
Expected output :
|table name | column | data type|
DMT_AAAAAAA C1111 NUMBER
DMT_AAAAAAA C1111 VARCHAR
BBBBBBBB A4444 NUMBER
JHD6365 H5525 VARCHAR
WRK679 C3020 VARCHAR
TDG5378 C66739 VARCHAR
Thank you.
owner in (...). Now you want only certain columns, too, so why don't you just add a conditioncolumn_name in (...)?