Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2003
    Posts
    63

    Unanswered: Table Relationships?

    which catalog table should I query to find the parent child relationship of a table?

    Thanks,
    toby

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    SYSCAT.REFERENCES

    Andy

  3. #3
    Join Date
    Sep 2003
    Posts
    63
    The syscat.references gives very few rows for my database. Shows just 6 relationships. I have many more constarnts/parent-child relationships in the database.

    Is there any command that will update the syscat.references table to reflect corrent relationship information.

    Thanks,
    toby

  4. #4
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    SYSCAT.REFERENCES is automatically filled in whenever a FOREIGN KEY is defined. e.g. ALTER TABLE mytable add CONSTRAINT myFK FOREIGN KEY (col1) references mytable1 (col2) ON DELETE NO ACTION ON UPDATE NO ACTION

    What are you selecting to get your result set.

    Andy

  5. #5
    Join Date
    Sep 2003
    Posts
    63
    I am running select * from syscat.references and its returning only 6 rows.

    Thanks,
    toby

  6. #6
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Have you explicitly defined the foreign keys either in the CREATE TABLE
    statements or ALTER TABLE statements?

    Andy

Posting Permissions

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