We help IT Professionals succeed at work.
Get Started

Oracle - Cannot Update To Null

cbridgman asked
Last Modified: 2016-03-03
I am attempting to set a value in one table to a value that I get from another table. The source table does not contain any null values in it but Oracle returns the following message each time I try.

SQL Error: ORA-01407: cannot update ("MXDB"."JOBPLAN"."JPDURATION") to NULL
01407. 00000 -  "cannot update (%s) to NULL"

This is the SQL that I'm using:

update jobplan JP
set JP.jpduration =
(select TMP.laborhrs
from tmp_hours TMP
where JP.jpnum = TMP.jpnum);

The TMP_HOURS table has only two columns: jpnum and laborhrs. Neither column contains null in any row.
The JOBPLAN table has many columns, two of which are jpnum and jpduration.

I am trying to set jobplan.jpduration to TMP_HOURS.laborhrs.

There is a matching record in the JOBPLAN table for every record in the TMP_HOURS table.

Any ideas what is going on?

The laborhrs and jpduration fields are both float.
Watch Question
Senior Oracle DBA
This problem has been solved!
Unlock 1 Answer and 6 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE