My Oracle Support Banner

ORA-918 When Different Subquery Blocks Use The Same Aliases In 11gR2 (Doc ID 1494660.1)

Last updated on AUGUST 04, 2018

Applies to:

Oracle Database - Enterprise Edition - Version 11.2.0.1 and later
Information in this document applies to any platform.

Symptoms

CT has upgraded their database from 10gR2 (10.2.0.2) to 11.2.0.3 and found a SQL with WITH clause returns ORA-918, but it worked fine on 10gR2.

It appears that this symptom is only reproducible on 11.2.0.* version.

11.1.0.7
========

ORA111: SEKIM> WITH ZTAB AS (
 2      SELECT SUPPLYCHAINID,DMID
 3      FROM ZTAB1 F
 4      WHERE F.SUPPLYCHAINID NOT IN (SELECT COLUMN_VALUE FROM TABLE(DM_COMMON.FNSPLIT('AAA|BBB','|')) S )
 5      AND   F.SUPPLYCHAINID NOT IN (SELECT COLUMN_VALUE FROM TABLE(DM_COMMON.FNSPLIT('AAA|BBB','|')) S )
 6  )
 7  SELECT (SELECT DM_COMMON.FNJOIN(CURSOR(SELECT SUPPLYCHAINID FROM ZTAB),'|')  FROM DUAL) SUPPLYCHAINID
 8        ,(SELECT DM_COMMON.FNJOIN(CURSOR(SELECT DMID          FROM ZTAB),'|')  FROM DUAL) DMID
 9  FROM DUAL         ;

SUPPLYCHAINID
----------------
------------------



ORA111: SEKIM>

 

11.2.0.1
========

SQL> WITH ZTAB AS (
 2      SELECT SUPPLYCHAINID,DMID
 3      FROM ZTAB1 F
 4      WHERE F.SUPPLYCHAINID NOT IN (SELECT COLUMN_VALUE FROM TABLE(DM_COMMON.FNSPLIT('AAA|BBB','|')) S )
 5      AND   F.SUPPLYCHAINID NOT IN (SELECT COLUMN_VALUE FROM TABLE(DM_COMMON.FNSPLIT('AAA|BBB','|')) S )
 6  )
 7  SELECT (SELECT DM_COMMON.FNJOIN(CURSOR(SELECT SUPPLYCHAINID FROM ZTAB),'|')  FROM DUAL) SUPPLYCHAINID
 8        ,(SELECT DM_COMMON.FNJOIN(CURSOR(SELECT DMID          FROM ZTAB),'|')  FROM DUAL) DMID
 9  FROM DUAL       ;
SELECT (SELECT DM_COMMON.FNJOIN(CURSOR(SELECT SUPPLYCHAINID FROM ZTAB),'|')  FROM DUAL) SUPPLYCHAINID
              *
ERROR at line 7:
ORA-00918: column ambiguously defined
ORA-06512: at "SEKIM.DM_COMMON", line 35
ORA-06512: at line 1

 

Changes

Upgrade is done to 11.2

Cause

To view full details, sign in with your My Oracle Support account.

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


In this Document
Symptoms
Changes
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.