Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2004
    Posts
    34

    Unanswered: How to get the definition of a column and relationship information

    Is this possible to get the definition of a column and relationship information in one big query in db2? On the other word, get column's name, data type, scale etc. as well as is this column a foreign key, a primary key, an identity etc. in one query.

    I know you can get definition of a column from syscat.column and relationship information from syscat.references, but I want to just use one query to get all these information, I wonder may be somebody already did it.

    Thanks in advance for your help,

    Kevin

    http://www.latticesoft.com

  2. #2
    Join Date
    Aug 2003
    Location
    Massachusetts, USA
    Posts
    106
    Take a look at sysibm.sqlforeignkeys which is a view that parses the fkcolnames found in sysibm.sysrel (which is used in the syscat.references view). You can then join this view to syscat.columns.

Posting Permissions

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