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

Table Load Sequence


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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

Moderator Emeritus


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

PostPosted: Thu Jun 03, 2010 1:03 am
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
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
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: 1281
Location: Belgium

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

load enforce no and do checks afterwards ?

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
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 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 How to load to DB2 with column level ... DB2 6
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Check data with Exception Table DB2 0
Search our Forums:

Back to Top