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

LOAD with UPDATE

Hi!

Is it possible to do an UPDATE of a table via LOAD command ?

Best regards,
Kovi
--
----------- Gregor Kovac -----------------------------------
In A World Without Fences Who Needs Gates? Experience Linux.
Sep 22 '06 #1
7 6982
Nope...Only these 4
>--+-------------------------------+--+-INSERT----+------------->
+-REPLACE---+
+-RESTART---+
'-TERMINATE-'

IMPORT has these options
>--+-+-INSERT---------+--INTO--+-table-name--+-------------------------+-+----------------------+-->
| +-INSERT_UPDATE--+ | | .-,-------------.
| | |
| +-REPLACE--------+ | | V |
| | |
| '-REPLACE_CREATE-'

cheers...
Shashi Mannepalli

Gregor Kovac wrote:
Hi!

Is it possible to do an UPDATE of a table via LOAD command ?

Best regards,
Kovi
--
----------- Gregor Kovac -----------------------------------
In A World Without Fences Who Needs Gates? Experience Linux.
Sep 22 '06 #2
Gregor Kovac( wrote:
Is it possible to do an UPDATE of a table via LOAD command ?
No, but IMPORT as UPSERT capability.

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

IOD Conference
http://www.ibm.com/software/data/ond...ness/conf2006/
Sep 22 '06 #3
Serge Rielau wrote:
Gregor Kovac( wrote:
>Is it possible to do an UPDATE of a table via LOAD command ?
No, but IMPORT as UPSERT capability.

Cheers
Serge
Hi!

Maybe I should describe my problem a bit more.
I have a table that has references to itself. So, basically a tree
structure. So I have to transfer data from this table into the same table,
but on diferrent database. So let's say the table it defined like this:
CREATE TABLE TAB1 (
TAB1_ID BIGINT,
TAB1_TAB1_ID BIGINT,
PRIMARY KEY (TAB1_ID),
FOREIGN KEY (TAB1_TAB1_ID) REFERENCES TAB1 (TAB1_ID)
)

Let's say that we have data like this:
TAB1_ID TAB1_TAB1_ID
1 NULL
2 3
3 1

Now when you EXPORT and then IMPORT back you get an error while IMPORTing
second row since TAB1_ID = 3 does now exist yet.

What is the solution ? :)

Best regards,
Kovi
--
----------- Gregor Kovac -----------------------------------
In A World Without Fences Who Needs Gates? Experience Linux.
Sep 23 '06 #4
load the tables in certain order
or
drop the foreign key constraint and rebuild after data loaded

Gregor Kovač 写道:
Serge Rielau wrote:
Gregor Kovac( wrote:
Is it possible to do an UPDATE of a table via LOAD command ?
No, but IMPORT as UPSERT capability.

Cheers
Serge

Hi!

Maybe I should describe my problem a bit more.
I have a table that has references to itself. So, basically a tree
structure. So I have to transfer data from this table into the same table,
but on diferrent database. So let's say the table it defined like this:
CREATE TABLE TAB1 (
TAB1_ID BIGINT,
TAB1_TAB1_ID BIGINT,
PRIMARY KEY (TAB1_ID),
FOREIGN KEY (TAB1_TAB1_ID) REFERENCES TAB1 (TAB1_ID)
)

Let's say that we have data like this:
TAB1_ID TAB1_TAB1_ID
1 NULL
2 3
3 1

Now when you EXPORT and then IMPORT back you get an error while IMPORTing
second row since TAB1_ID = 3 does now exist yet.

What is the solution ? :)

Best regards,
Kovi
--
----------- Gregor Kovac -----------------------------------
In A World Without Fences Who Needs Gates? Experience Linux.
Sep 23 '06 #5
Hardy wrote:
load the tables in certain order
this does not work on a table that has references to itself
or
drop the foreign key constraint and rebuild after data loaded
yes, but I wouldn't want the table be in an inconsistent state. What if, by
some strange coincidence, there are missing some rows that the foreign key
points to ? Then the application won't work as it is supposed to. Oh, well,
I'll figure something out.
Gregor Kovač 写道:
>Serge Rielau wrote:
Gregor Kovac( wrote:
Is it possible to do an UPDATE of a table via LOAD command ?
No, but IMPORT as UPSERT capability.

Cheers
Serge

Hi!

Maybe I should describe my problem a bit more.
I have a table that has references to itself. So, basically a tree
structure. So I have to transfer data from this table into the same
table, but on diferrent database. So let's say the table it defined like
this: CREATE TABLE TAB1 (
TAB1_ID BIGINT,
TAB1_TAB1_ID BIGINT,
PRIMARY KEY (TAB1_ID),
FOREIGN KEY (TAB1_TAB1_ID) REFERENCES TAB1 (TAB1_ID)
)

Let's say that we have data like this:
TAB1_ID TAB1_TAB1_ID
1 NULL
2 3
3 1

Now when you EXPORT and then IMPORT back you get an error while IMPORTing
second row since TAB1_ID = 3 does now exist yet.

What is the solution ? :)

Best regards,
Kovi
--
----------- Gregor Kovac -----------------------------------
In A World Without Fences Who Needs Gates? Experience Linux.
--
----------- Gregor Kovac -----------------------------------
In A World Without Fences Who Needs Gates? Experience Linux.
Sep 23 '06 #6
Gregor Kovač wrote:
Hardy wrote:
>load the tables in certain order

this does not work on a table that has references to itself
>or
drop the foreign key constraint and rebuild after data loaded

yes, but I wouldn't want the table be in an inconsistent state. What if, by
some strange coincidence, there are missing some rows that the foreign key
points to ? Then the application won't work as it is supposed to. Oh, well,
I'll figure something out.
How big is your table?
Note that RI is tested at the end of statement. So if you insert all
rows in one go order shouldn't matter.
If your table is truly a directed graph without cycles (doesn't have to
be a tree) then an order exists to insert one row at a time.
A recursive query can be written to produce the rows starting from the
root level by level.

Cheers
Serge

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

IOD Conference
http://www.ibm.com/software/data/ond...ness/conf2006/
Sep 23 '06 #7
Serge Rielau wrote:
Gregor Kovač wrote:
>Hardy wrote:
>>load the tables in certain order

this does not work on a table that has references to itself
>>or
drop the foreign key constraint and rebuild after data loaded

yes, but I wouldn't want the table be in an inconsistent state. What if,
by some strange coincidence, there are missing some rows that the foreign
key points to ? Then the application won't work as it is supposed to. Oh,
well, I'll figure something out.
How big is your table?
Note that RI is tested at the end of statement. So if you insert all
rows in one go order shouldn't matter.
If your table is truly a directed graph without cycles (doesn't have to
be a tree) then an order exists to insert one row at a time.
A recursive query can be written to produce the rows starting from the
root level by level.

Cheers
Serge
Currently there are about 50 rows in there. At the end I imagine there will
be 1000 rows in that table.

Best regards,
Kovi
--
----------- Gregor Kovac -----------------------------------
In A World Without Fences Who Needs Gates? Experience Linux.
Sep 25 '06 #8

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

Similar topics

3
by: chrisspen | last post by:
Is there a way to loop through all instantiated objects and update their classes when a source file changes? I know about Michael Hudson's method...
9
by: Stefan Bauer | last post by:
Hi NG, we've got a very urgent problem... :( We are importing data with the LOAD utility. The input DATE field data is in the format DDMMYYYY (for days) and MMYYYY (for months). The target...
6
by: Vivek Sharma | last post by:
I have two tables that have a master detail relationship. i.e. Load has multiple partitions. I am using UDB v8. LOAD ------------- id status 1 0 2 0 3 0
1
by: Carmine | last post by:
I'm getting this error when I submit the job: DSNU000I DSNUGUTC - OUTPUT START FOR UTILITY, UTILID = LOADSQL DSNU005I DSNUGPRS - EXEC SQL DSNU082I DSNUGPRS - INVALID KEYWORD - EXEC...
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...
2
by: Scotty | last post by:
I get stuck to write an update, insert and delete command, i am looking for some help to start Whats the best way to update 2 tables toe the database (Access) below my code used to load my...
3
by: J055 | last post by:
Hi I have a PlaceHolder control inside a FormView EditItemTemplate: <asp:PlaceHolder ID="phResponseText" runat="server"> <tr> <td> <asp:Label ID="lblResponseText"...
6
by: | last post by:
Hi, I'm steel trying to read and update my XML file with Visual Basic Express but i am unable to find the right way to read my xml file and update it if neccessary... Here is my problem :...
10
by: sara | last post by:
Hi - I have been struggling with solution ideas for this now for almost 2 weeks, and have not been able to figure this out. I have a user who creates a Purchase Order (tblPOData). In some...
0
by: Sumanth | last post by:
Hi, We are running into some issues when doing LOAD. 1) client issues a cliload at T1 2) db2diag.log indicates that the load,build phase completes in 2 minutes. This happens at T1 + 30 mins...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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.