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
 
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: 6970
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: 6970
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 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