Merge Into Statement from JDBC 11g Application Shows Incorrect Results (Doc ID 1312224.1)

Last updated on MARCH 08, 2017

Applies to:

JDBC - Version 11.2.0.1 and later
Information in this document applies to any platform.

Symptoms

Application using JDBC driver 11.2.0.2 executes a merge statement which should only create one row, but two rows are created instead.


MERGE INTO USER_ACCOUNT ua USING (/**/ SELECT/**/ :1
USER_ACCOUNT_ID,/**/ :2 USER_ACCOUNT,/**/ :3
ACCOUNT_OPENED,/**/ :4 ACCOUNT_EFFECTIVE, /**/
CURRENT_TIMESTAMP UPDATED,/**/
CURRENT_TIMESTAMP CREATED,/**/ :5
OWNER_ORG_ID/**/ FROM DUAL/**/) rec/**/ON
(rec.USER_ACCOUNT = ua.USER_ACCOUNT AND rec.OWNER_ORG_ID = ua.OWNER_ORG_ID)
/**/WHEN NOT MATCHED THEN/**/ INSERT ( ua.USER_ACCOUNT_ID,
ua.USER_ACCOUNT, ua.ACCOUNT_OPENED, ua.ACCOUNT_EFFECTIVE, ua.UPDATED,
ua.CREATED, ua.OWNER_ORG_ID)/**/ VALUES (rec.USER_ACCOUNT_ID,
rec.USER_ACCOUNT, rec.ACCOUNT_OPENED, rec.ACCOUNT_EFFECTIVE, rec.UPDATED,
rec.CREATED, rec.OWNER_ORG_ID);


The application runs successfully against Oracle Server 10.2.0.5, but shows the unexpected result when run against Oracle Server 11.2.0.1.

Changes

Upgrade from Oracle Server 10.2.0.5 to 11.2.0.1.

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms