Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2010
    Posts
    19

    Unanswered: find the foreign key constraints for a table

    hello

    i need sql statements that find foreign key constrints for a table and the key fields of the two tables - the fileds that has unique constraint or primary key and the fields ot the other table which has defined foreign key constraint ...

    table 1 table2
    primary key, unique fields <---------------------------------------------- foreign key fields

    i need the name of the key filed which are involved in the foreign key constrain

    please help

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    Have a look at

    sysibm.SQLFOREIGNKEYS
    or
    syscat.tabconst and syscat.keycoluse
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  3. #3
    Join Date
    Nov 2005
    Location
    IL
    Posts
    557
    you might want to download "SQL Reference Vol.1.pdf"
    --
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows

    DB2 v9.7.0.6 os 6.1.0.0

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •