Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2003

    Unanswered: find out identity,primary key etc.

    Is there any quickest way or command to find out

    1.Identity column in a table

    2.Primary key column and keys

    3.Ref. Integrity/foreign Key


  2. #2
    Join Date
    Nov 2002
    Run the db2look against the table and it will give you everything you need, look at the options to get what you need in the output
    David Quigley

  3. #3
    Join Date
    Jan 2005
    Rio de Janeiro - Brazil

    Another option

    Instead of running the DB2LOOK utility you can just run queries against the catalog views to gather the information you want.

    Id suggest you pay a visit to the SQL References to for a description about those views (SYSCAT schema).

    For a start, according to the information you requested, take a look at the: SYSCAT.TABLES, SYSCAT.COLUMNS, SYSCAT.INDEXES, SYSCAT.REFERENCES, SYSCAT.TABCONST.

    Depending on what youre trying to do, itll have a better result than the DB2LOOK utility.

    Now, if you just want to get the DDL statements to backup the structure, or copy it to another location, I strongly recommend using the DB2LOOK.

    Hope it helps.

Posting Permissions

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