Home » RDBMS Server » Server Administration » how to get index and keys description
how to get index and keys description [message #375238] Tue, 07 August 2001 23:33 Go to next message
lana
Messages: 1
Registered: August 2001
Junior Member
I created a table with an index and a primary key.
I do not know what command to use in order to see
description of table with all its indexes and keys.
Please help.
Re: how to get index and keys description [message #375239 is a reply to message #375238] Wed, 08 August 2001 06:39 Go to previous messageGo to next message
Senthil
Messages: 68
Registered: December 1999
Member
To describe/get table(e.g. emp) info...

SQL> desc emp

To get index name associated with the table...
SQL> select index_name from user_indexes where table_name = 'EMP';

To get all details about the index...
SQL> select * from user_indexes where table_name = 'EMP'

To get the constraint information...
SQL> select constraint_name, constraint_type from user_constraints where table_name = 'EMP'

To get columns involved in the constraints...
SQL> select constraint_name, column_name, position from user_cons_columns where constraint_name in (select constraint_name from user_constraints where table_name = 'EMP');

HTH.

thanks,
senthil.
Re: how to get index and keys description [message #375249 is a reply to message #375238] Sun, 12 August 2001 13:36 Go to previous message
Sudhakar Atmakuru
Messages: 58
Registered: May 2001
Member
You can try with USER_TABLES, USER_TAB_COLUMNS and USER_IND_COLUMNS built-in ORACLE tables. They give you the info of tables existing/created, columns created in tables, and indexes cretaed on those columns respectively, in your database session.
Good luck.
Previous Topic: Synchronizing database
Next Topic: where exists elimination
Goto Forum:
  


Current Time: Tue Dec 24 07:42:41 CST 2024