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!

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

mist123Mar 9 2022

Hi All,
Oracle: 11.2

MERGE INTO AR_PAYMENT_SCHEDULES_ALL tableA
USING (
	SELECT tx.receipt_number rcptno,tx.attribute6 rcpt_id
	FROM	ar_cash_receipts_all tx
   )		src
ON (tableA.trx_number = src.rcptno)
WHEN MATCHED THEN UPDATE 
SET  tableA.trx_number = REPLACE (src.rcptno, '000000000', src.rcpt_id)
where src.rcptno='000000000-CC-1737029'

Getting ORA-38104 - What is a workaround to updating the column in the ON clause in a MERGE?
why it is not working? Can you please help me with this?

Comments
Post Details
Added on Mar 9 2022
3 comments
760 views