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: 6967
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: 6967
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: 1281
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 Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm
No new posts unload data from table with lob columns farhad_evan DB2 0 Sat Apr 22, 2017 1:32 pm
No new posts Copy load modules and alias vasanthz IBM Tools 5 Thu Apr 20, 2017 6:31 am
No new posts Data replication from multiple Db2 ta... kishpra DB2 9 Mon Mar 27, 2017 9:58 pm
No new posts how to send just 10 rows in a CICS sc... Megha Gupta CICS 5 Thu Feb 23, 2017 6:57 pm


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