I want to set a NOT NULL column to nullable AND also set default value to NULL
I have tried:
alter table T_FUNCIO modify (VALIDATED NULL DEFAULT NULL);
alter table T_FUNCIO modify VALIDATED NULL DEFAULT NULL;
but none of the 2 works
You have the clauses the wrong way around. From the syntax diagrams, the DEFAULT ... clause comes before the inline constraint. So you can do:
alter table T_FUNCIO modify VALIDATED DEFAULT NULL NULL;
Note though that if the column is already nullable, which is the default if you didn't specify it at table creation (as is the default value being null of course), then this will still throw "ORA-01451: column to be modified to NULL cannot be modified to NULL". You said your column is currently NOT NULL though, so this should be fine.
you can try this
ALTER TABLE T_FUNCIO
MODIFY VALIDATED int DEFAULT NULL
NOT NULL constraint? (Also restating the data type isn't necessary...)The syntax is a little counter-intuitive:
alter table T_FUNCIO modify (VALIDATED NULL)
Here is a db<>fiddle.