Primary and Foreign Key information in Teradata
Teradata Teradata Discussion Forums Teradata.com Discussion Forum
Visit Teradata.com
Home       Guidelines    Member List
Welcome Guest ( Login | Register )
        


This online forum is for user-to-user discussions of Teradata products, and is not an official customer support channel for Teradata. If you require direct assistance, please contact Teradata support.


Primary and Foreign Key information in... Expand / Collapse
Author
Message
Posted 8/5/2008 6:18:38 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 8/5/2008 6:33:45 PM
Posts: 2, Visits: 2
I am using Teradata SQL Assistant.
The SHOW TABLE provides only the structure of the table but NOT the table relationships like Primary Key and Reference Key.

Can you please let me know which is the command to get the structure and the KEY (relationship)

Thanks
Post #12453
Posted 8/6/2008 1:27:49 PM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: Yesterday @ 1:34:04 PM
Posts: 117, Visits: 238
Look at DBC.Indices view. The IndexType is set to K for Primary Key.

IndexType: Returns the type of an index as:
• P (Nonpartitioned Primary)
• Q (Partitioned Primary)
• S (Secondary)
• J (join index)
• N (hash index)
• K (primary key)
• U (unique constraint)
• V (value ordered secondary)
• H (hash ordered ALL covering secondary)
• O (valued ordered ALL covering secondary)
• I (ordering column of a composite secondary index)
• M (Multi-column statistics)
• D (Derived column partition statistics)
• 1 (field1 column of a join or hash index)
• 2 (field2 column of a join or hash index)

Also see dbc.ALL_RI_PARENTS, dbc.ALL_RI_Children views.
It is all explained in Data Dictionary manual.


Shaw
Post #12462
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 ( 0 guests, 0 members, 0 anonymous members )
No members currently viewing this topic.


All times are GMT -5:00, Time now is 6:36pm

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.031. 10 queries. Compression Disabled.