Sql Query to pull table name and column name
15 April, 2010

If you are looking to get all table name and column in a oracle schema you can use the following query

SELECT * FROM DBA_TAB_COLUMNS WHERE OWNER = 'schema_name' ;

If you want to get column names of a specific table then you can use the following query

SELECT * FROM DBA_TAB_COLUMNS WHERE OWNER = 'schema_name' AND TABLE_NAME LIKE 'table_name';

If you just want to get the table names of a schema without column names and other details

SELECT distinct TABLE_NAME FROM DBA_TAB_COLUMNS WHERE OWNER = 'schema_name';

---

Commenting is closed for this article.