473,385 Members | 1,766 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,385 software developers and data experts.

DB2 Load into multiple tables using control centre


I am trying to use DB2 Control Centre (version 8.2) to load one flat
file into multiple tables. However, I don't see the options in Control
Centre that allows that.

Anyone knows how to do this?

DB2 Novice

Nov 12 '05 #1
8 3545
DB2 Novice wrote:
I am trying to use DB2 Control Centre (version 8.2) to load one flat
file into multiple tables. However, I don't see the options in Control
Centre that allows that.

Anyone knows how to do this?

DB2 Novice

In one shot using load.. No.
How do you distribute the data. Do you parition vertically (column 1 - n
to T1, rest to T2) or horizontally (some rows to T1 some rows to T2).
There are multiple options:
For vertical partitioning the simplest approach would be to just use two
LOAD commands
For horizontal partitioning I woudl load the fiel into a staging table
and then either run two loads from cursor or, if you want only one scan:
BEGIN ATOMIC
FOR row AS SELECT * FROM staging DO
INSERT INTO T1 SELECT * FROM TABLE(VALUES(row.c1, ...)) AS S WHERE
<cond1>;
INSERT INTO T2 SELECT * FROM .... <cond2>;
END
%

Cheers
Serge

--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #2

Thanks serge.
One more question on this Load or import. I believe the only that
really separate these tools is the speed. Either way, I believe my
accounting department people can still read the tables when I load or
import the data? I am just wondering
why load doesn't support one load into multiple tables like what DB2
import can do?

DB2 Novice

Nov 12 '05 #3
DB2 Novice wrote:
Thanks serge.
One more question on this Load or import. I believe the only that
really separate these tools is the speed. Either way, I believe my
accounting department people can still read the tables when I load or
import the data? I am just wondering
why load doesn't support one load into multiple tables like what DB2
import can do?

DB2 Novice

Uhm.. IMPORT does NOT support multiple targets in one shot. What I
posted was regular SQL.
Anyway the difference betwen IMPORT and LOAD is that IMPORT uses an SQL
interface ethat is it will fire trigger. And yes. It will be slower
There is an online LOAD capability and I think (?) similar options are
available for IMPORT. The way it works is that the loaded data remains
invisible until LOAD is completed and integrity of the data has been
verified by the SET INTEGRITY statement (to maintain e.g. RI, MQTs (aka
materialized/indexed views)

Cheers
Serge

--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #4
Load data is invisible til it's issued with set integrity. Waht about
the existing data? AFAIK, table lock is acquired for Load operation.

Nov 12 '05 #5
Ora Dummy wrote:
Load data is invisible til it's issued with set integrity. Waht about
the existing data? AFAIK, table lock is acquired for Load operation.


Quick lookup for Online Load in teh Information center:
"Online table load

When loading data into a table in Version 8, the table space in which
the table resides will no longer be locked. Users have full read and
write access to all the tables in the table space, except for the table
being loaded. For the table being loaded, the existing data in the table
will be available for read access if the load is appending data to the
table.

These new load features significantly improve the availability of the
data and help customers deal with the maintenance of large data volumes
and shrinking maintenance windows. "
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #6
You cannot load into multiple tables using one command.
load into table one by one, specify the position in the file.
"DB2 Novice" <db*******@yahoo.com> wrote in message news:<11*********************@o13g2000cwo.googlegr oups.com>...
I am trying to use DB2 Control Centre (version 8.2) to load one flat
file into multiple tables. However, I don't see the options in Control
Centre that allows that.

Anyone knows how to do this?

DB2 Novice

Nov 12 '05 #7

Serge,

Thanks. That is for table lock for DB2 Load. However, those users who
are using
import utility is still not so fortunate to still read let alone write
while the table is being imported.
DB2 Novice

Nov 12 '05 #8
DB2 Novice wrote:
Serge,

Thanks. That is for table lock for DB2 Load. However, those users who
are using
import utility is still not so fortunate to still read let alone write
while the table is being imported.

Is that so? Check out online import:
http://publib.boulder.ibm.com/infoce...6f%72%74%22%20

Noe that all I do to find these thing sis type in the obvious search
patterns "online load" and "online import" into teh information center.

Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Shabam | last post by:
A web application of mine developed using C# + MS SQL runs fine normally. However when I stress test it with a load testing software (using about 60 simultaneous users) some instances start...
9
by: John Kirksey | last post by:
I have a page that uses an in-place editable DataGrid that supports sorting and paging. EnableViewState is turned ON. At the top of the page are several search fields that allow the user to filter...
8
by: Jason L James | last post by:
Hi all, does anyone know if I can create a dataview from multiple datatables. My dataset is constructed from four separate tables and then the relationships are added that link the tables...
53
by: Alan Silver | last post by:
Hello, I understand the issue that tables should be used for tabular data and not for layout, but I would like some clarification as to exactly what constitutes tabular data. For example, if...
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....
5
by: Markus Ernst | last post by:
Hello This is a test example: http://www.markusernst.ch/anthracite/ http://www.markusernst.ch/anthracite/living_divani.html After googling and experimenting for several hours, I ended up...
2
by: Sean Staniforth | last post by:
I have a Database which contains anout 20 tables. each has different data. for a research centre studying Family History. I want to create a simple from end that researchers can entre a surname &...
3
by: ApexData | last post by:
I'm starting a new project. A Personnel System. I have considered opening a single bound form to the main employee table. The user can scroll the records to any individual. I would like to have a...
2
by: ZBINContact | last post by:
I am creating a self-checking set of usercontrols. They tend to call their self-checking functionally in the "Load" event. I have run into a problem with my TextBox usercontrol, however, as the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.