Results 1 to 2 of 2

Thread: foriegn key!

  1. #1
    Join Date
    Mar 2003
    Posts
    7

    Unanswered: foriegn key!

    hi all

    i use this query

    describe indexes for table emp show detail

    i get the results...like primary key and other unique keys set to this table i want to see what are the foreign keys set to this table...how to see that...can any help me pls?

    thank you
    siva!

  2. #2
    Join Date
    Mar 2003
    Posts
    33

    Re: foriegn key!

    You can get that information (or at least some) from sysibm.sysrels -table. That table contains colums: creator, tbname, relname, reftbname, reftbcreator, colcount, deleterule, updaterule, timestamp, fkcolnames, pkcolnames, refkeyname, definer .

    query could be something like this:
    db2 "select tbname, relname, fkcolnames,... from sysibm.sysrels where reftbname = 'mytable' "




    Originally posted by etlsiva
    hi all

    i use this query

    describe indexes for table emp show detail

    i get the results...like primary key and other unique keys set to this table i want to see what are the foreign keys set to this table...how to see that...can any help me pls?

    thank you
    siva!
    -r-

Posting Permissions

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