Results 1 to 3 of 3

Thread: Constraints

  1. #1
    Join Date
    Jun 2004
    Posts
    38

    Thumbs up Unanswered: Constraints

    Is there is any way by which I can find the constraint related to a table under db2 v8.1

  2. #2
    Join Date
    Mar 2004
    Location
    Toronto, ON, Canada
    Posts
    513
    Quote Originally Posted by ksolomon
    Is there is any way by which I can find the constraint related to a table under db2 v8.1
    db2look is the nicest/easiest way, if you use it with '-e' and '-a' it'll dump out all the ddl for the database, including constraints.

    You can also monkey around with the system catalog tables, as described in the appendix of SQL Ref vol 1. SYSCAT.TABCONST is the one I think you want.
    --
    Jonathan Petruk
    DB2 Database Consultant

  3. #3
    Join Date
    Jan 2004
    Location
    UK
    Posts
    52

    Thumbs up

    check -> SYSCAT.TABCONST table.
    It contains a row for each unique (U), primary key (P), foreign key (F) and table check (K) constraint.

Posting Permissions

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