Suppose I have a database with a large number of tables.
- Is there any command that I can type in PL/SQL which display only the field names of a given table?
- Given any table is there any command that I can type that would show all the relations that it has with other tables?
For example , I have a table "TAB_1" , can I type a command that would show all the tables related to and for any table "TAB_2" that it is related to it would show which field in "TAB_1" corresponds to which field in "TAB_2 " .
Best Answer
You can query the system views and look at metadata.
You will get a list of tables using this view:
For a list of columns, you can join the TABLES list with the column views:
There are similar views for:
You can then join some of them and write such a query for a list of columns involved in referential integrity contraints:
With
R
being(referential integrity)
for constraint_type.