0

Im looking for an Oracle SQL statement that will show me all the table names, structures and constraint information that I have created.

Would it be something along the lines of

Select * from user_tables;
Jack
  • 343
  • 2
  • 8
  • 19
  • 1
    possible duplicate of [Displaying the constraints in a table](http://stackoverflow.com/questions/1837793/displaying-the-constraints-in-a-table) and [Get list of all tables in Oracle?](http://stackoverflow.com/questions/205736/get-list-of-all-tables-in-oracle) and [How can I describe a table in Oracle](http://stackoverflow.com/questions/9855209/how-can-i-describe-a-table-in-oracle-without-using-the-describe-command) – Kermit May 07 '13 at 13:48
  • All the data dictionary views are documented in the Reference manual which is online. Read it here: http://docs.oracle.com/cd/E11882_01/server.112/e25513/index.htm#US – APC May 07 '13 at 14:33

1 Answers1

0

This is the official oracle query you should use to select the tables for the current user:

  SELECT table_name FROM user_tables;

or

SELECT table_name
  FROM dba_tables

or

SELECT table_name
  FROM all_tables

for selecting all constraints for a table:

SELECT * FROM USER_CONSTRAINTS WHERE TABLE_NAME = ""

or

SELECT * FROM USER_CONSTRAINTS WHERE TABLE_NAME='EMP';

(This will list you all the constraints from that particular user in which you are logged in.)

Community
  • 1
  • 1
Max
  • 12,622
  • 16
  • 73
  • 101