Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
DB2 Table structure Help

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 680
Location: NJ

PostPosted: Mon Apr 03, 2006 5:49 pm    Post subject: DB2 Table structure Help
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    Post subject:
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: 680
Location: NJ

PostPosted: Mon Apr 03, 2006 6:31 pm    Post subject: Regarding Table structure
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    Post subject:
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    Post subject:
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: 680
Location: NJ

PostPosted: Wed Apr 05, 2006 1:07 pm    Post subject: table description
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm
No new posts Table(Unicode(Graphic) table) loading... muralikrishnan_new DB2 0 Thu Oct 05, 2017 5:10 pm
No new posts Insert a Row_number into table useit DB2 2 Tue Sep 19, 2017 1:07 pm
No new posts how to see when the last read access ... Mike 1304 DB2 1 Tue Sep 12, 2017 7:52 pm
No new posts PC (UTF-8) -> z/OS (EBCDIC) -> ... prino All Other Mainframe Topics 4 Fri Sep 01, 2017 1:47 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us