Entering content frame

This graphic is explained in the accompanying text FOREIGNKEYS Locate the document in the library structure

Prerequisites

You have generated the Structure linkdemo data for the SQL Tutorial.

Log on to the demo database instance DEMODB as user MONA.

Create referential constraints. Proceed as described in SQL Tutorial, Structure linkForeign Key Dependencies Between Tables.

Examples

You can use the system table FOREIGNKEYS to determine the following database information, among other things:

     All referential constraints in which the RESERVATION table is the referencing table

SELECT fkeyname, tablename
  FROM DOMAIN.FOREIGNKEYS
    WHERE tablename = 'RESERVATION'

     All referential constraints generated with the DELETE CASCADE rule

SELECT schemaname, fkeyname
  FROM DOMAIN.FOREIGNKEYS
    WHERE rule = 'DELETE CASCADE'

Note

Columns in referential constraints: see FOREIGNKEYCOLUMNS

 

Leaving content frame