Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Listing tables via SQL

Status
Not open for further replies.

ded

Programmer
Nov 3, 2000
41
GB
Does anyone know if it is possible to write a piece of SQL which will return a list of the tables in the database?

Thanks.
 
Try this:

SELECT table_name
FROM user_tables Terry M. Hoey
th3856@txmail.sbc.com
While I don't mind e-mail messages, please post all questions in these forums for the benefit of all members.
 
select table_name,owner from dba_tables
(includes all the dba tables)
OR

select table_name, owner from all_tables
(the same as above but does not include the dba tables - but will include the ones owned by SYS )

Hope this helps.....
 
SELECT table_name FROM user_tables; -- RETURNS ALL OF THE TABLES YOU OWN
SELECT table_name FROM all_tables; -- RETURNS ALL OF THE TABLES YOU HAVE
PRIVILEGES ON
SELECT table_name FROM dba_tables; -- RETURNS ALL OF THE TABLES IN THE
DATABASE
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top