title: Oracle - Update case when then else part do nothing
body: <p>In Oracle DB, have a table called Details. The Details table data shown below.</p>
  
  <pre><code>Name | Age
  --------------
   xxx  |  4
   yyy  |  1
   zzz  |  10
  </code></pre>
  
  <p>Required to swap ages from 4 to 1 &amp; 1 to 4 without disturbing age 10. I used below query which yields error in Oracle sql developer.</p>
  
  <pre><code>update details set age= case when age=4 then 1 
  when age=1 then 4 end;
  </code></pre>
  
  <p>tried below query also:</p>
  
  <pre><code>update details set age= case when age=4 then 1 
  when age=1 then 4 
  else null end;
  
  
  Error report for both queries:
  SQL Error: ORA-01407: cannot update ("DETAILS"."AGE") to NULL
  01407. 
  *Cause:    
  *Action:
  </code></pre>