|
Re: How to find primary key ,foreign key , index and sequence associated to a table [message #617274 is a reply to message #617273] |
Thu, 26 June 2014 11:42 |
|
EdStevens
Messages: 1376 Registered: September 2013
|
Senior Member |
|
|
The first 3 (PK, FK, unique) are all revealed in the dba_constraints view.
As for sequences ... while the primary use of a sequence is probably to populate a PK, there is no inherent, dictionary-defined connection between a sequence and a table. In reality, a sequence's sole purpose is to provide a number. Period. Full stop. How you use that number -- say, to populate a PK column -- is entirely up to you and is implemented in your code. That code could be a trigger or procedure, it could be application code written in any language and residing anywhere. If it is NOT implemented as a trigger, there is no guarantee/enforcement of its use as a PK. And there is also no guarantee that sequence is used for only one table.
|
|
|
|