Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

 

 
 

ORA-01407: cannot update (string) to NULL tips

Oracle Error Tips by Burleson Consulting (S. Karam)

The Oracle docs note this on the ORA-01407 error:

ORA-01407 cannot update (string) to NULL

Cause: An attempt was made to update a table column "USER"."TABLE"."COLUMN" with a NULL value.

For example, if you enter:

connect scott/tiger
update table a (a1 number not null);
insert into a values (null);

Oracle returns:

ORA-01407 cannot update ("SCOTT"."A"."A1") to NULL

which means you cannot update the column "SCOTT"."A"."A1" to NULL.

Action: Retry the operation with a value other than NULL.

ORA-01407 occurs as you are trying to change a column to NULL when the column does not accept NULL values.

To resolve ORA-01407, try correcting theeUPDATEEstatement to binsurethat a when a column is defined assNOT NULLL, there is no attempt toUPDATEEit with aaNULLLvalue. You may want to reference the Oracle documentation about ORA-01407 for an example..

In an update with a equality sub-select, one solution to the ORA-01407 error in SQL is to check for NULL rows using the where exists clause:

update ORDERS ord
set ord.amount = (select ord.qty * it.item_price
from ITEM it
where ord.item_id = it.item_id);

Error: ORA-01407: cannot update ("MYSCHEMA"."ORDERS"."AMOUNT") to NULL

This removes the ORA-01407 error:

update ORDERS ord
set ord.amount = (select ord.qty * it.item_price
from ITEM it
where ord.item_id = it.item_id)
where exists (select 1
from ITEM it
where ord.item_id = it.item_id);
commit;

 


 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright ? 1996 -  2014

All rights reserved by Burleson

Oracle ? is the registered trademark of Oracle Corporation.


 

??
 
  
 
 
 

 
 
 

Oracle training Excel
 
Oracle performance tuning software