473,320 Members | 1,884 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

load sequence and tables hierarchy

2
Hi Experts..I am trying to create data load process . I have bunch of different queries to load data in around 400 tables. I want to load the data in parent-child tables order to avoid any constraint violation. So if hit a table, first i want to find all the parents and child for that and start loading data from parent all the way down to child..I have having hard time achieving it. Any help is appreciated..If somehow i can develop a view with tables and loading order..Thanks in advance..
Gulrez
Mar 31 '11 #1
3 4093
vijay2082
112 100+
Hi Gulrez,

I wonder why you need to device for this much complexity when DB2 offers it in a much simpler way. Follow the below steps for loading data making the constraint valid post load.

Step1) Identify the tables to be loaded( no need for any order or parent/foreign ket relationship to be know at this time).

Step2) Load the data using DB2 Load utility and specify the clause "SET INTEGRITY PENDING CASCADE". Look at below link for more load options.

http://publib.boulder.ibm.com/infoce.../r0008305.html

Step3) Once all your load is complete identify all the tables which have been placed in Check Pending state and run "set integrity" against those tables.

You can build a simple query to check all the tables in check pending state ( e.g query the STATUS flag from syscat.tables view for value C , which indicates that the table is in Check pending state). Use below link for more information.
http://publib.boulder.ibm.com/infoce.../c0004593.html

Step4) You are ready to use all the tables at this step.

Cheers, Vijay
Mar 31 '11 #2
GULREZ
2
Thanks Vijay for taking time to respond..But i am loading data using federated database. So these are just INSERT statements based on query getting data from federated database. So can i use LOAD utility using cursor..But i know there will be lot of constraint violations. According to yr advise, i will again have to load all the exceptions. Pls let me know if i m missing something...
Apr 1 '11 #3
vijay2082
112 100+
Hi ,

You can try the load from cursor option. Once you load the data you can check for the constrait voilation. I don't think you need to reload the data from exceptions table.
Remember that constraint voilation during load will be only for below reason/case:
"An exception table should be used when loading data which has a unique index and the possibility of duplicate records. If an exception table is not specified, and duplicate records are found, the load operation continues, and only a warning message is issued about the deleted duplicate records. The records themselves are not logged."

What is the federated data source and your current environment details. If it's a DB2 UDB database then you can directly load from the source into target using the load command starting version 9.

Some tips could be :

1) Identify the data and try to have filtered data without duplicates.

2) If source is DB2 UDb only and you are into recent version ( Version 9+) then try to use new features with Load and save your time in the whole activity.

3) Try to find out a simplified solution for first time and automate it for subsequent load operation which will save your time and extra effort.

4) Remember that in any case you would always want to have unique records in your table at any point in time rather than duplicates and then dealing with it at later time.

Cheers, Vijay
Apr 5 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: csomberg | last post by:
I'm doing some performance reviews and wish to know what tables SQL has pinned in memory and which ones have are loaded through usage ... Is there a way ? Thanks, Craig
1
by: Victor Spång Arthursson | last post by:
Hi! Have a problem, probably easy to solve... I want to dump a database which resides on my local server with another, and not existing, owner than the one who actually owns it locally. The...
1
by: David Frankel | last post by:
I have created an MDC table using UDB ESE v8.1 fixpack 6 on AIX 5.1. The table is organized by 3 columns with a product of 100 * 3 * 5 values -- only 1500 values. When I try to use the load utility...
1
by: John Hunter | last post by:
I've recently had a nasty problem with the "Invalid reference to the property Form" error in subforms - nasty because it doesn't seem to consistently happen to all forms which contain the same...
1
by: Shelby | last post by:
Problem: My company generates its own data export from a propietary database. These (free) tables can be read in C#.NET using a Visual FoxPro driver (vfpoledb). I can read each of the six tables...
4
by: Kent Johnson | last post by:
Hi all, I have a code that is supposed to load three tables in a dataset. This works fine with one Dropdownlist1 but not with the other Dropdownlist2. Tables(0) = "Table0" : Tables(1) =...
1
by: Justin | last post by:
What is the best/easiest way to update multiple tables at a time? Can you recommend any tutorials? Thanks, Justin.
3
by: rodchar | last post by:
hey all, i have an employee master table that i've broken up into many tables using normalization and what made logical sense (i.e. Education table, Equipment table, military history table, etc....
1
by: (PeteCresswell) | last post by:
I'm loading a TreeView control from a recordset that's sequenced by a date. When I step through the code, I *think* I'm seeing the nodes created in the expected sequence. Problem is, when the...
18
by: Narshe | last post by:
I've been struggling with this for a while. I have a business entity Employee that has a Company entity attached to it. Ex: public class Compay{ // blah } public class Employee
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.