Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

ORA-38104: Columns referenced in the ON Clause cannot be updated:

1973864Dec 19 2018 — edited Dec 20 2018

hI ALL,

I am running below query receiving error, please correct .

MERGE INTO APPS.PN_LOCATIONS_ALL D

USING (

SELECT

A.PROPERTY_ID,

L.BUILDING,

L.FLOOR,

L.LOCATION_CODE,

A.UNIT_MODEL

FROM

APPS.PN_PROPERTIES_ALL P,

APPS.PN_LOCATIONS_ALL L,

APPS.EM_PN_PROPERTY_ATTRIBUTES A,

APPS.HR_ALL_ORGANIZATION_UNITS OU

WHERE

    P.PROPERTY_ID = A.PROPERTY_ID

AND L.LOCATION_ID = A.LOCATION_ID

AND P.ORG_ID = OU.ORGANIZATION_ID

AND P.ORG_ID = L.ORG_ID

AND L.ORG_ID = A.ORG_ID

AND L.ORG_ID IN (102,121)

AND L.LOCATION_TYPE_LOOKUP_CODE = 'OFFICE'

AND L.BUILDING LIKE '%CVR%'

AND L.FLOOR LIKE '%Plot%'

AND L.LOCATION_CODE LIKE 'CVR Project-Plot-1'

AND A.UNIT_MODEL LIKE 'Plot-1'

  

   ) S

   ON (D.PROPERTY_ID = S.PROPERTY_ID AND  D.BUILDING=S.BUILDING AND D.FLOOR = S.FLOOR AND  D.LOCATION_CODE=S.LOCATION_CODE )

   WHEN MATCHED THEN UPDATE SET D.FLOOR = 'CVR-ST 01'

Comments
Post Details
Added on Dec 19 2018
31 comments
12,172 views