sikyala
asked on
how do I change a field to allow null values
I have a field that currently does not accept null values when inserting a record. I need to modify that field to accept null values. It is not the primary key in the table. What is the syntax for doing this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
nope, works exactly as posted
I tested it before posting
ee.txt
ee.txt
Okay, I ran into that issue once before but I think it was for an earlier version. Sorry.
no problem, I tested on 10g and 11g, didn't go back any further because the posted zone was 10.x
ASKER
Thanks sdstuber!
What was the error message when you insert nulls?
ASKER
It was someone else working on a development server. They just asked me if I could fix the problem. I found out recently that they made the field in question a primary key and it should not be a primary key. So I am trying to figure out the name of the primary key so that I can drop it and then change the column to accept null values.
I think the syntax requires parentheses with that usage -
alter table YOUR_TABLE modify (YOUR_COLUMN null);
but I also think you can use -
alter table YOUR_TABLE modify COLUMN YOUR_COLUMN null;