Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

updating date to null

I am trying to update a enroll_date row to null and it is telling me "cannot update (%s) to NULL", so I tried doing putting TO_CHARand it still doesn't help...

enroll_date shows this which I want to make it to null

ENROLL_DATE 
07-FEB-07  

This is what I have

UPDATE ENROLLMENT
SET TO_CHAR(ENROLL_DATE) = NULL
WHERE STUDENT_ID ='125'
      AND SECTION_ID ='61';

how can I set enroll_date to null ?

like image 701
Manual Avatar asked Apr 27 '26 09:04

Manual


1 Answers

Remove the TO_CHAR function. You're updating a column, not the function'd value

UPDATE ENROLLMENT
SET ENROLL_DATE = NULL
WHERE STUDENT_ID ='125'
      AND SECTION_ID ='61';
like image 78
gvee Avatar answered Apr 29 '26 02:04

gvee