473,396 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,396 software developers and data experts.

merge error (udb db2 v8.1.5 linux)

Does the following message get generated before or after the additional
conditions given in the merge are evaluated?

Error: The same row of target table "NULLID.AICA" was identified more
than once for an update, delete or insert operation of the MERGE statement.

The merge statement was:

// put the bhid into all of the records SHOULD BE 8
merge into nullid.AICA t1 using is3.animals t2
on t1.assoc=t2.assoc and t1.regnum=t2.regnum
when matched and
t1.bhid is null and
t1.prefix is null and
t2.prefix is null and
t1.regnum is not null and
t2.regnum is not null
then update set t1.bhid=t2.bhid
go

Is the message generated before all of the and conditions are evaluated
or after?
Nov 12 '05 #1
1 1886
Bob Stearns wrote:
Does the following message get generated before or after the additional
conditions given in the merge are evaluated?

Error: The same row of target table "NULLID.AICA" was identified more
than once for an update, delete or insert operation of the MERGE statement.

The merge statement was:

// put the bhid into all of the records SHOULD BE 8
merge into nullid.AICA t1 using is3.animals t2
on t1.assoc=t2.assoc and t1.regnum=t2.regnum
when matched and
t1.bhid is null and
t1.prefix is null and
t2.prefix is null and
t1.regnum is not null and
t2.regnum is not null
then update set t1.bhid=t2.bhid
go

Is the message generated before all of the and conditions are evaluated
or after?

Yet another MERGE question.. hmmm.

The message is generated after the ON clause evaluates.
The extra conditions for WHEN MATCHED are e.g. to distinguish between
DELETE and UPDATE situtation.

So either you have to move some of those conditions into the ON clause
or you need to GROUP the source BY assoc, regnum - and aggregate.

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

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

Similar topics

0
by: global | last post by:
Hi, can anyone help me I'm on Linux with UDB Runtime-Client 8.1.4 and try to connect to a windows udb-server 8.1.4 via Websphere and jdbc , and get this error: 3e1a29e5 WebGroup E...
0
by: Hemant Shah | last post by:
Folks, I have DB2 UDB 7.2 EE installed on AIX 5.2 system. I think I am at latest fixpack, see output of lslpp below. I have also installed DB2 UDB 7.2 EE on RedHat Linux 7.3 I believe that is...
2
by: afreema | last post by:
We have a WebSphere application that quit working this week. It was trying to hit DB2 UDB Version 8 on Linux. The Driver is DB2 V7. This is the message in the WebSphere logs. Does anyone know...
2
by: Cam Chapman | last post by:
Does anyone have any experience migrating a DB2 database off UDB 6.1 (Solaris) to 7.2 (Linux)? The database does not already exist on the Linux box. Have created a DB2 instance fine. DB2...
4
by: Bob Stearns | last post by:
The statement: merge into nullid.animals_et_in t1 using is3.animals t2 on t1.sire_assoc=t2.assoc and t1.sire_prefix=t2.prefix and t1.sire_regnum=t2.regnum when matched then update set...
2
by: Mamidinx | last post by:
Hi, With the MERGE statement I am using in DB2 it rolls back all the way if an error is encountered. Is there a way to save each of the encountered exception but proceed to the next data record...
3
by: Bob Stearns | last post by:
We have a very poorly performing MERGE statement (an hour or more on tables of ~10000 and ~100000). This may require building temporary tables with appropriate indexes, but I thought I would ask...
3
by: subramanian100in | last post by:
Consider the following program: #include <cstdlib> #include <iostream> #include <set> #include <map> #include <algorithm> #include <iterator> #include <utility>
0
by: rajkumargnv | last post by:
I know there are differences in MERGE Statement in UDB and z/OS like in z/Os only one 'WHEN MATCHED', one 'WHEN NOT MATCHED' are allowed. My question is more about USING clause, does it always...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.