Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2004
    Posts
    21

    Unanswered: Find PrimaryKey Columns...

    Hi Guys,

    can anybody tell me how to find out which columns are member of the primary key from any table in a DB2 database?

    Thanks,
    Marc

  2. #2
    Join Date
    Aug 2002
    Location
    Chennai, India
    Posts
    184
    One way to do this is to use db2look utility...

    db2look -d test -e -a -t employee -o employee.ddl

    Where 'test' is the database name & 'employee' is the table name.

    The output file employee.ddl will have the DDL for employee table which will also have the primary key SQL statement.

    You can also use the syscat.keycoluse catalog table to get this information.

    HTH.

  3. #3
    Join Date
    Jun 2004
    Posts
    21

    Thnak you...

    Thank you! Did found it in the DB2 catalog tables/views.

    Regards,
    Marc
    Last edited by VitaminB; 05-22-06 at 06:34.

Posting Permissions

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