Hi
I have created many tables in database. Now when i used to create new table that's name may already exists. So, before creating new table i must know which table names are already exists in my database.
And for that i want to display all the tables created in database. As we can dispaly all the columns of a table by using select * from table_name So. please tell me such a query by which i can display list of all tables exists in my database.

Recommended Answers

All 3 Replies

Hi Dipti,

You can use the below querry to get the table names in your DB:

select * from tab;

hi,

use below query to get all table names in database

SELECT TABLE_SCHEMA + '.' + TABLE_NAME, *
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE = 'BASE TABLE'
ORDER BY TABLE_SCHEMA + '.' + TABLE_NAME

commented: please do not post if you do not know the answer. +0

select * from all_tables;

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.