NEED PK, FK, and index of table narrowed down by Schema, table and KEY name if possible

Database
N/A

NEED PK, FK, and index of table narrowed down by Schema, table and KEY name if possible

Hi all, and thanks in advance for your help.

I need to find all PK, FK and index on certain tables. They need to be narrowed down so i can check if a certain table under my schema with a particular name has any keys or indexes and how many. Ive been able to figure it out for all others db;s but TD is giving me trouble. Can someone help or at least send me in the right direction.

thanks,

Adam

PS: Essentially what we do is subset data from one DB to another. I need to verify if the subsetted table has all the same keys, and indexes of the original table. thanks again.
4 REPLIES
N/A

Re: NEED PK, FK, and index of table narrowed down by Schema, table and KEY name if possible

Index: dbc.Indices
FK: dbc.ri_distinct_children and dbc.ri_distinct_parents
PK: Teradata replaces any PK definition with a unique index, UPI or USI
But PrimaryKeyIndexId in dbc.Tables keeps track of the original PK, this might be joined to dbc.indices.

Dieter
N/A

Re: NEED PK, FK, and index of table narrowed down by Schema, table and KEY name if possible

hey man, thanks very much, this appears to be working for me. p.
N/A

Re: NEED PK, FK, and index of table narrowed down by Schema, table and KEY name if possible

hey dieter,

for the foreign keys, is there any way to get the actual name of the column in my query?
N/A

Re: NEED PK, FK, and index of table narrowed down by Schema, table and KEY name if possible

Yep,
there's dbc.all_ri_children and dbc.all_ri_parents

Dieter