IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

DB2 Table structure Help


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 677
Location: NJ

PostPosted: Mon Apr 03, 2006 5:49 pm
Reply with quote

Hi folks,

I was suppose to insert a value in to a table it shows -530 error. Its due to foreign key problem. But i cannot resolve it. I dont know the structure of that table. I searched the way in SYSIBM.SYSFOREIGNKEYS but i get the foreign key name not how it was related. I think if i came to know the description of the table i might solve this problem easily. How can i find the description of the table???? It s an emergency can anyone plz help me .

Thx in adv.../
Back to top
View user's profile Send private message
thanooz

New User


Joined: 28 Jun 2005
Posts: 99

PostPosted: Mon Apr 03, 2006 6:15 pm
Reply with quote

hi khamarutheen,

can you use Sysibm.syscolumns for display table strucrure;

Thank's
thanooz.
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 677
Location: NJ

PostPosted: Mon Apr 03, 2006 6:31 pm
Reply with quote

Hi Thanooz,

I too tried with that but i need the relationship of the keys. I can get the Foreign key but i want to know that key table's desc. Hope u catch my point.
Back to top
View user's profile Send private message
martin9

Active User


Joined: 01 Mar 2006
Posts: 290
Location: Basel, Switzerland

PostPosted: Mon Apr 03, 2006 9:43 pm
Reply with quote

hy khamarutheen,

go to db2 administrator
and look at the table definitions a.s.o....
find it in ispf primary option menu
with g.d.2.a ...

martin9
Back to top
View user's profile Send private message
thanooz

New User


Joined: 28 Jun 2005
Posts: 99

PostPosted: Mon Apr 03, 2006 10:11 pm
Reply with quote

hi khamarutheen,

you can try with this sysibm.sysrels it gives the relationship of constarines;

SYSIBM.SYSRELS contains information about referential constraints, and each
constraint is uniquely identified by the creator and name of the dependent table and
the constraint name (RELNAME). SYSIBM.SYSFOREIGNKEYS contains
information about the columns of the foreign key that defines the constraint. To
retrieve the constraint name, column names, and parent table names for every
relationship in which the project table is a dependent, execute:
SELECT A.CREATOR, A.TBNAME, A.RELNAME, B.COLNAME, B.COLSEQ,
A.REFTBCREATOR, A.REFTBNAME
FROM SYSIBM.SYSRELS A, SYSIBM.SYSFOREIGNKEYS B
WHERE A.CREATOR = 'DSN8710'
AND B.CREATOR = 'DSN8710'
AND A.TBNAME = 'PROJ'
AND B.TBNAME = 'PROJ'
AND A.RELNAME = B.RELNAME
ORDER BY A.RELNAME, B.COLSEQ;
You can use the same tables to find information about the foreign keys of tables to
which the project table is a parent, as follows:
SELECT A.RELNAME, A.CREATOR, A.TBNAME, B.COLNAME, B.COLNO
FROM SYSIBM.SYSRELS A, SYSIBM.SYSFOREIGNKEYS B
WHERE A.REFTBCREATOR = 'DSN8710'
AND A.REFTBNAME = 'PROJ'
AND A.RELNAME = B.RELNAME
ORDER BY A.RELNAME, B.COLNO;


I think this will help's you

thank's
thanooz
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 677
Location: NJ

PostPosted: Wed Apr 05, 2006 1:07 pm
Reply with quote

Hi folks,

Thanks for u all for ur quick responses. I tried with all of the options and finally i m sorry to say that the foreign key defenition was defined incorrectly so only the data is not accepted. Its the mistake of the database designer. Any way the problem is solved. Once again thanks for all to share ur ways in our forum....
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Load new table with Old unload - DB2 DB2 6
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Check data with Exception Table DB2 0
No new posts Dynamically pass table name to a sele... DB2 2
Search our Forums:

Back to Top