15.10 - Define Foreign Key Constraints - Teradata Administrator

Teradata Administrator User Guide

prodname
Teradata Administrator
vrm_release
15.10
category
User Guide
featnum
B035-2502-035K

Selecting Foreign Key from the Constraint button in the Create Table dialog box displays the Define Foreign Key Constraints dialog box.

Use the Define Foreign Key Constraints dialog box to define the references of Foreign Key constraints for the table.

 

Table 17: Define Foreign Key Constraints Dialog Box Description 

Field or Control

Description

Foreign Key

This list displays the name of each Foreign Key constraint specified for the table. Selecting a constraint in the list then displays its specifications in the Key Columns and References Columns lists.

Table Columns

This list displays all the columns specified for the table.

Select the columns to be used as the basis for a Foreign Key constraint Reference specification.

  • Do one of the following:
  • From the Table Columns list, double-click on the column name to add it to the Key Columns list.
  • Or, click once to highlight the column and click Add to add it to the Key Columns list.
  • Key Columns

    This list shows all of the columns selected to provide Foreign Key constraint values.

  • Do one of the following:
  • From the Key Columns list, double-click on the column name to remove it from the list.
  • Or, click once to highlight the column and click Remove.
  • Name

    Use this field to specify an optional name for the Foreign Key constraint. The name specified is displayed in the Foreign Key list when the Add button is used to save your constraint specification.

    Note: Constraint names are optional. If a name is not entered, Teradata Administrator displays UnNamed in this field and creates the table without a constraint name specification.

    References

    Database and Table Name

    The database specified on the Create Table dialog box is initially selected and its tables listed.

    Use this list to specify the Reference database and table name attribute for your Foreign Key constraint.

    This list first displays all of the databases in the Teradata Database. Then, after the database is selected for the reference name field. The list displays all of the tables in the selected database.

    When a table is selected, all of the columns of the selected table display in the Table Columns list.

    Table Columns

    This list shows all the columns in the table selected for the Reference specification.

    Select the columns to be used as the basis for a Reference specification.

  • Do one of the following:
  • From the Table Columns list, double-click on the column name to add it to the Reference Columns list.
  • Or, click once to highlight the column and click Add to add it to the Reference Columns list.
  • Reference Columns

    This list shows all of the columns selected to provide Reference values.

    Note: Reference columns are optional. If no reference columns are specified, the reference is to the primary index of the selected table.

  • Do one of the following:
  • From the Reference Columns list, double-click on the column name to remove it from the list.
  • Or, click once to highlight the column and click Remove.