473,320 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Listing DB2 Constraints

Tim
I have spent the last 2-3 hours trying to find a way to just list the
constraints for a given table (this includes referential - foriegn
keys, not just check constraints).

I know how to create them, but can I see them, no way. Howz it done
people, let me in on the secret.

I tried SYSIBM.SYSCHECKDEP but this doesnt show foriegn key
constraints.
Nov 12 '05 #1
3 24996
"Tim" <ti*******@rogers.com> wrote in message
news:60**************************@posting.google.c om...
I have spent the last 2-3 hours trying to find a way to just list the
constraints for a given table (this includes referential - foriegn
keys, not just check constraints).

I know how to create them, but can I see them, no way. Howz it done
people, let me in on the secret.

I tried SYSIBM.SYSCHECKDEP but this doesnt show foriegn key
constraints.


DB2 for OS/390 or z/OS ??
Nov 12 '05 #2
SYSCAT.REFERENCES contains foreign key constraints. In a UNIX environment, I
use the db2look utility with the -t option for a table. It will dump the DDL
including all check constraints and foreign keys.

Evan
"Tim" <ti*******@rogers.com> wrote in message
news:60**************************@posting.google.c om...
I have spent the last 2-3 hours trying to find a way to just list the
constraints for a given table (this includes referential - foriegn
keys, not just check constraints).

I know how to create them, but can I see them, no way. Howz it done
people, let me in on the secret.

I tried SYSIBM.SYSCHECKDEP but this doesnt show foriegn key
constraints.

Nov 12 '05 #3
Evan Smith <es********@hotmail.com> wrote:
SYSCAT.REFERENCES contains foreign key constraints. In a UNIX environment,
I use the db2look utility with the -t option for a table. It will dump the
DDL including all check constraints and foreign keys.

Evan
"Tim" <ti*******@rogers.com> wrote in message
news:60**************************@posting.google.c om...
I have spent the last 2-3 hours trying to find a way to just list the
constraints for a given table (this includes referential - foriegn
keys, not just check constraints).

I know how to create them, but can I see them, no way. Howz it done
people, let me in on the secret.

I tried SYSIBM.SYSCHECKDEP but this doesnt show foriegn key
constraints.


Have a look at SYSCAT.TABCONST.

--
Knut Stolze
Information Integration
IBM Germany / University of Jena
Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Phil Powell | last post by:
create table if not exists nnet_produkt_varegruppe ( nnet_produkt_varegruppe_id int not null auto_increment, primary key(nnet_produkt_varegruppe_id), nnet_produkt_varegruppe_navn varchar(255) not...
2
by: Paul | last post by:
Hi: I am not sure whether somebody can sort it out for me. I am doing data transfer from one oracle database to another. Both of them has the same structure (like same tables etc).the only...
0
by: Rajesh Kapur | last post by:
We use InnoDB tables and foreign key constraints extensively. The mysqldump backs up the database tables in alphabetical order with foreign key constraints defined in the create statement of each...
4
by: Dmitri | last post by:
I just looked at a coworker's stored procedure and this person is dropping 4 Foreign key constraints and then re-adding them after processing the required logic (updating rows in the 4 tables in...
2
by: DW | last post by:
Greetings: I have to do a one-off forceful change of some data in a database. I need to disable some FK constraints, make the data change, and then re-enable the constraints. My process will...
10
by: serge | last post by:
I am doing a little research on Google about this topic and I ran into this thread: ...
0
by: BobTheDatabaseBoy | last post by:
i've Googled some this morning, but to my surprise, i don't find any offering (for fee or open source), which would integrate with, say Jakarta Struts, to provide the UI edits from cataloged...
4
by: srikanthr | last post by:
how do i get the constraints associated with a table. is there any system table which stores the constraint details. Atleast how do I know if a column is nullable or not
4
by: Bobby Edward | last post by:
I have an xsd dataset. I created a simple query called GetDataByUserId. I can preview the data fine! I created a very simple BLL function that calls it and returns a datatable. When I run...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.