Natavia Finnie
asked on
Oracle SQL - Select all table names from all schemas
I would like to select ALL the table names where employer_code exist and data_precision from all schemas in a database.
slightwv's solution would give you tables that have at least one of the columns.
If the table needs to have both columns, try this:
If the table needs to have both columns, try this:
SELECT owner,
table_name
FROM dba_tab_columns
WHERE column_name IN ( 'EMPLOYER_CODE', 'DATA_PRECISION' )
GROUP BY owner,
table_name
HAVING Count(1) > 1
ASKER
'DATA_PRECISION' is an attribute like Table_name of the tables which gives you the column length. I need the data_precision of the "Employer_code" column where ever employer_code exist
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The online docs have all the columns available:
https://docs.oracle.com/en/database/oracle/oracle-database/19/refrn/ALL_TAB_COLUMNS.html#GUID-F218205C-7D76-4A83-8691-BFD2AD372B63
https://docs.oracle.com/en/database/oracle/oracle-database/19/refrn/ALL_TAB_COLUMNS.html#GUID-F218205C-7D76-4A83-8691-BFD2AD372B63
ASKER
Thanks all
select owner, table_name, column_name from dba_tab_columns where column_name in ('EMPLOYER_CODE','DATA_PRE
You'll need DBA level access. If you don't have it, try all_tab_columns but you will miss tables you don't have permissions to see.