Home | Previous Page | Next Page   The Table Option > Displaying Table Information >

Displaying Column Constraints and Defaults

When you select the cOnstraints option from the INFO menu, the CONSTRAINTS menu appears, as Figure 98 shows.

Figure 98. The CONSTRAINTS Menu
CONSTRAINTS - mytab:    Reference  Primary Check Unique Defaults Exit
Referenced and referencing options.

------------------mydata@mydbserv-------------- Press CTRL-W for Help -------

You can select from the following options on the CONSTRAINTS menu.

Option Purpose Instructions
Reference Shows referential (foreign-key) constraints associated with the specified table Displaying Referential Constraints
Primary Shows primary-key columns in the specified table Figure 102
Check Shows check constraints on columns in the specified table Figure 103
Unique Lists columns that must contain unique data none
Defaults Lists columns for which default values are defined and the default value none
Exit Returns to the INFO menu none

Displaying Referential Constraints

When you select the Reference option from the CONSTRAINTS menu, the REFERENCE menu appears, as Figure 99 shows.

Figure 99. The REFERENCE Menu
REFERENCE - mytab:   Referencing  referenceD Exit
Display foreign key constraints.

-----------------mydata@mydbserv-------------- Press CTRL-W for Help --------

The REFERENCE menu lets you display the following information:

Select the Referencing option on the REFERENCE menu to display the foreign-key constraints in the current table, as Figure 100 shows.

Figure 100. The REFERENCE Menu with Referencing Information
REFERENCE - myaccts:   Referenc  referenceD Exit
Display referential constraints.

-----------------sub_accounts -----------Press CTRL-W for Help ----------------

Constraint Name    Referencing Column   Referenced Table   Referenced Column  CD
r107_13            ref_num           sub_accounts          acc_num            Y
                   ref_type                                acc_type

r107_13            ref_num           accounts              acc_num            Y
                   ref_type          acc_type

Select the referenceD option on the REFERENCE menu to display other tables and columns that reference your current columns as foreign keys, as Figure 101 shows.

Figure 101. The REFERENCE Menu with Referenced Information
REFERENCE - myaccts:  Referenc  referenceD  Exit
Display columns which have foreign keys which reference this table.

------------------accounts ------------Press CTRL-W for Help ------------------

Constraint Name    Referenced Column   Referencing Table   Referencing Column  CD
r107_13            acc_num           sub_accounts          ref_acc             Y
                   acc_type                                ref_type

Select Exit to return to the CONSTRAINTS menu.

Sample Primary and Check Constraint Displays

Figure 102 shows the columns that form a primary key. This display results from selecting Primary from the CONSTRAINTS menu.

Figure 102. The CONSTRAINTS Menu with Primary-Key Constraint Information
CONSTRAINTS - mytab:  References  Primary  Check Unique Defaults Exit
Primary key constraints

-----------------mydata@mydbserv------------------ Press CTRL-W for Help ------

Constraint Name     Column Name

constraint1     assembly 
                  partnum

Select the Check option on the CONSTRAINTS menu to display the check constraints placed on columns of the current table, as Figure 103 shows.

Figure 103. The CONSTRAINTS Menu with Check-Constraint Information
CONSTRAINTS - mytab:  Reference Primary  Check  Unique Defaults Exit
Display check constraints.

--------------------mydata@mydbserv------------- Press CTRL-W for Help -------

Constraint name            Value

cons2                      (column1 > (column2 * 100 - 1000 + column1 / 2 -
                           column2/20 + 40 * 3 - 55 * column2 + 77 * column1))

cons3                      column2 > column3

cons4                      column3 > 100
Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]