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-01407 with UPDATE using COALESCE function

ltzwomanDec 4 2012 — edited Dec 4 2012
Hi

We're trying to run the following query as part of an upgrade:

UPDATE LAWSON.NATBALANCE
SET STATEMENT_REQ=(SELECT COALESCE(acm.STATEMENT_REQ,' ')
FROM LAWSON.ARCUSTOMER acm
WHERE acm.NAT_FLAG='N'
AND LAWSON.NATBALANCE.NAT_COMPANY=acm.COMPANY AND
LAWSON.NATBALANCE.NAT_CUSTOMER=acm.CUSTOMER)

But we're getting the following error:

ORA-01407: cannot update ("LAWSON"."NATBALANCE"."STATEMENT_REQ") to null.

I’m confused by this for a couple of reasons. First, the STATEMENT_REQ field in LAWSON.ARCUSTOMER contains no NULLS, and second I thought the whole purpose of the COALESCE function was to return the first non-null result. What am I missing here?

Edited by: ltzwoman on Dec 4, 2012 10:48 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 1 2013
Added on Dec 4 2012
6 comments
1,423 views