Link to home
Start Free TrialLog in
Avatar of sikyala
sikyalaFlag for United States of America

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
Avatar of mmeisel
mmeisel
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Sean Stuber
Sean Stuber

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
sdstuber,
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;
Avatar of Sean Stuber
Sean Stuber

nope, works exactly as posted
I tested it before posting
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
Avatar of sikyala

ASKER

Thanks sdstuber!
What was the error message when you insert nulls?
Avatar of sikyala

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.