Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Table Load Sequence

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

New User


Joined: 19 Jun 2008
Posts: 39
Location: USA

PostPosted: Thu Jun 03, 2010 12:02 am    Post subject: Table Load Sequence
Reply with quote

Hello,

I have a complex DB2 database where the RI relation is complex (parent, child relationship). I am trying to create a load process for whole database, but I don't have sequence (order) to load the tables. Can anyone suggest on this?

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

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Jun 03, 2010 1:03 am    Post subject:
Reply with quote

Hello,

Depending on specifics, you could load all of the tables that have no RI constraints. Then load the tables that require these other tables to be loaded.

Again, depending on specifics, you might consider taking off the RI until after the tables are loaded. This depends on 100% of the data being valid as relates to the RI rules or there will be problems.

Possibly, i have misunderstood the question. . .
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Jun 03, 2010 1:33 am    Post subject:
Reply with quote

there are topics in this forum that discuss determining the RI relationships between tables.
a search should provide that sql.

or you can start with E.1 Retrieving catalog information about ...

here are 4 sysibm.tables that will help:
SYSIBM.TABLE_CONSTRAINTS
SYSIBM.CHECK_CONSTRAINTS
SYSIBM.REFERENTIAL_CONSTRAINTS
SYSIBM.REF_CONSTRAINTS
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Jun 03, 2010 1:40 am    Post subject:
Reply with quote

Besides,
some DBA in your shop has this documented. try checking with him/her.
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1278
Location: Belgium

PostPosted: Thu Jun 03, 2010 8:01 pm    Post subject:
Reply with quote

load enforce no and do checks afterwards ?

http://ibmmainframes.com/viewtopic.php?t=46958
Back to top
View user's profile Send private message
satyender

New User


Joined: 05 Jan 2008
Posts: 50
Location: Olympia, WA, USA

PostPosted: Fri Jun 04, 2010 4:21 am    Post subject:
Reply with quote

trilokdewangan,

Try the below query:

SELECT NAME, '' AS PARENT_NAME FROM SYSIBM.SYSTABLES A WHERE CREATOR = 'USER_ID' AND NAME NOT IN
(SELECT TBNAME FROM SYSIBM.SYSRELS WHERE CREATOR = 'USER_ID' )
UNION
SELECT A.TBNAME AS NAME , A.REFTBNAME AS PARENT_NAME FROM SYSIBM.SYSRELS A WHERE CREATOR = 'USER_ID'
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 SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts Need Rexx Program to Load in to DB2 T... Hareesh Verma CLIST & REXX 22 Tue Sep 20, 2016 2:59 pm
No new posts Copybook structure in Load module Vai123 COBOL Programming 7 Fri Sep 16, 2016 8:29 pm
No new posts Sequence number add in SORT pshongal SYNCSORT 3 Fri Sep 02, 2016 3:32 pm
This topic is locked: you cannot edit posts or make replies. ERROR WHILE SUBMITTING LOAD JOB ANURADHA NEELAKANTAN JCL & VSAM 12 Thu Aug 25, 2016 11:50 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us