oracle list columns in schema

Solutions on MaxInterview for oracle list columns in schema by the best coders in the world

showing results for - "oracle list columns in schema"
Maximilian
01 Jun 2017
1-- Depending on connected user grants:
2SELECT * FROM USER_TAB_COLS WHERE TABLE_NAME = 'my_table';	-- User tables
3SELECT * FROM ALL_TAB_COLS WHERE TABLE_NAME = 'my_table';	-- Available to user
4SELECT * FROM DBA_TAB_COLS WHERE TABLE_NAME = 'my_table';	-- All schemas
5
6-- Columns from all tables in a schema (adapt with USER_..., DBA_... or ALL_...):
7SELECT c.TABLE_NAME, c.DATA_TYPE FROM ALL_TAB_COLS c
8JOIN ALL_TABLES t ON t.OWNER = c.OWNER
9WHERE OWNER = 'my_schema';
Tom
15 Jan 2019
1SELECT *
2FROM all_tab_cols;
Ana
21 Sep 2019
1-- Depending on schema grants:
2SELECT * FROM USER_TAB_COLS WHERE TABLE_NAME = 'my_table';	-- User tables
3SELECT * FROM ALL_TAB_COLS WHERE TABLE_NAME = 'my_table';	-- Access granted
4SELECT * FROM DBA_TAB_COLS WHERE TABLE_NAME = 'my_table';	-- All schemas
5
6-- Columns from all tables in a schema (or USER_..., DBA_... instead of ALL_...):
7SELECT c.TABLE_NAME, c.DATA_TYPE FROM ALL_TAB_COLS c
8JOIN ALL_TABLES t ON t.OWNER = c.OWNER
9WHERE OWNER = 'my_schema';