How to remove default constraint from a column in Db2

I had a table STUDENT_TB in which there was a column STUDENT_ID, NAME, AGE. I added a column with the following command: -

alter table STUDENT_TB add DOB TIMESTAMP NOT NULL DEFAULT CURRENT TIMESTAMP 

as for the DOB column, I did not want it to be null. Now I need to remove this default restriction.

I tried to search, but did not get any success.

Sincerely.

+4
source share
2 answers

I tried with this and it worked fine

 alter table STUDENT_TB alter DOB drop DEFAULT 
+6
source

ALTER TABLE STUDENT_TB ALTER COLUMN DOB DROP NOT NULL

+1
source

All Articles