If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Reg System catalog tables

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-30-06, 06:43
mahi123 mahi123 is offline
Registered User
 
Join Date: Dec 2005
Posts: 8
Reg System catalog tables

Hi...can anyone please help me with the following query?

Assuming that the create table statement is executed successfully,

CREATE TABLE T1 (COL1 INTEGER NOT NULL, PRIMARY KEY(COL1))

which 2 of the following system catalogs are updated?

a) SYSCAT.INDEXES
b) SYSCAT.PRIMARY KEYS
c) SYSCAT.TABLES
d) SYSCAT.NOTNULLABLECOLS
e) SYSCAT.CONSTRAINTS

I feel the answer is 'a' and 'c'...but i am not sure if there is any SYSCAT.CONSTAINTS...

Please let me know the correct answers.
Reply With Quote
  #2 (permalink)  
Old 07-31-06, 02:48
rahul_s80 rahul_s80 is offline
Registered User
 
Join Date: Jul 2006
Location: Pune , India
Posts: 433
Yes a,c is the right ans.
Details about primary keys can be found in syscat.indexes as unique indexes are always formed on creation of primary key.
Foreign key constraints can be found in syscat.references
Reply With Quote
  #3 (permalink)  
Old 07-31-06, 03:00
Peter.Vanroose Peter.Vanroose is offline
Registered User
 
Join Date: Sep 2004
Location: Belgium
Posts: 1,079
In addition, the COLUMNS catalog table is updated too; that's where NOT NULL conditions (and defaults) are stored.
SYSCAT.CHECKS contains the check constraints. (None in this case.)
__________________
--_Peter Vanroose,
__IBM Certified Database Administrator, DB2 9 for z/OS
__IBM Certified Application Developer
__ABIS Training and Consulting
__http://www.abis.be/
Reply With Quote
  #4 (permalink)  
Old 07-31-06, 14:51
mahi123 mahi123 is offline
Registered User
 
Join Date: Dec 2005
Posts: 8
Thanks for the replies Rahul and Peter...really appreciate your help..!!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On