How does Oracle show tables in the database?

454    Asked by DipikaAgarwal in SQL Server , Asked on Mar 13, 2023

I'm trying to do a SHOW TABLES command in my Oracle Database 19c as documented here.


But when I run that command all I see in the output of SQL Developer is this:


Show tables handled. How can I get SHOW TABLES to give me a list of tables in the schema?

Answered by Diya tomar

The documentation you referenced is not for Oracle 19c; it is for a defunct project that is completely unrelated. Oracle database does not have an oracle SHOW TABLES command. Depending on what you're looking for, you would need to select from one of the following data dictionary views to get a list of tables:


USER_TABLES - contains info on the current user's tables
ALL_TABLES - contains info on all tables that the current user has privileges to access
DBA_TABLES - contains info on all tables in the instance, but requires elevated privileges to access

For example:

select table_name from user_tables;
For more information on the data dictionary, check out the correct Oracle 19c documentation here: https://docs.oracle.com/en/database/oracle/oracle-database/19/index.html
As another example, if you're trying to confirm the existence of a table named "EMPLOYEE", you could run this query:
SELECT * FROM all_tables WHERE table_name = 'EMPLOYEE'

Your Answer

Interviews

Parent Categories