472,965 Members | 1,970 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,965 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 3515
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: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.