Deprecated: Function set_magic_quotes_runtime() is deprecated in /nfs/c01/h08/mnt/2939/domains/cidamon.com/html/blog/textpattern/lib/txplib_db.php on line 14
Cidamon: Blog: Sql Query to pull table name and column name
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.