By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,756 Members | 1,721 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,756 IT Pros & Developers. It's quick & easy.

Merge does not work on 8.1.0

P: n/a
Hi,

I have developed an SQL-Script which I tested successfully on DB2
v8.1.3.132 (SQL08013). When I tried to run the script on a DB2 v8.1.0.36
(SQL08010) the script failed with the message

SQL0104N Auf "MERGE " folgte das unerwartete Token "INTO DB". Zu den
möglichen Token gehören: "<space>". SQLSTATE=42601

The english translation is probably this one:

SQL0104N An unexpected token "INTO DB" was found following "MERGE ".
Expected tokens may include: "<space>". SQLSTATE=42601
Does anybody know why the merge did not succeed? Are there any
differences between 8.1.0 and 8.1.3 or different configuration settings
which could be responsible for that?

Thanks
Sebastian

MERGE INTO DB.TABLENAME AS DEST USING (
SELECT
NAME NAME
, PLZ PLZ
FROM DB.TABLENAME_TMP) AS TEMP
ON (DEST.NAME = TEMP.NAME)
WHEN MATCHED THEN
UPDATE SET
DEST.NAME = TEMP.NAME
, DEST.PLZ = TEMP.PLZ
WHEN NOT MATCHED THEN
INSERT (
DEST.NAME
, DEST.PLZ )
VALUES (
TEMP.NAME
, TEMP.PLZ );
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Sebastian Luemmer wrote:
Hi,

I have developed an SQL-Script which I tested successfully on DB2
v8.1.3.132 (SQL08013). When I tried to run the script on a DB2 v8.1.0.36
(SQL08010) the script failed with the message

SQL0104N Auf "MERGE " folgte das unerwartete Token "INTO DB". Zu den
möglichen Token gehören: "<space>". SQLSTATE=42601

The english translation is probably this one:

SQL0104N An unexpected token "INTO DB" was found following "MERGE ".
Expected tokens may include: "<space>". SQLSTATE=42601\


The MERGE statement was introduced in FP2. The 8.1.0 is the GA level of DB2
V8.1. So you should install at least FP2 to get the MERGE functionality.

You can see that this is in FP2 and onwards by looking at the documentation
http://publib.boulder.ibm.com/infoce...n/r0010873.htm
The "2" at the left border marks that something has changed in the FP2 or
that this functionality is new.

--
Knut Stolze
Information Integration
IBM Germany / University of Jena
Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.