View previous topic :: View next topic
|
Author |
Message |
Avinash_Gupta
New User
Joined: 11 May 2005 Posts: 26 Location: Hyderabad
|
|
|
|
Hi,
I have a DB2 table in which all columns are declared NOT NULL.I had to add two more columns in the table later.I added the columns using ALTER command but i forgot to add the not null constraint.
Is there any way which can help me in making the modification so that the last two colums added by me become NOT NULL.
Please let me know if there is a solution to it.
Regards |
|
Back to top |
|
|
ragshere
New User
Joined: 20 Dec 2004 Posts: 70
|
|
|
|
Hi avinash,
You need to drop and recreate the table by adding NULL parameters.
There is no other option. Before dropping the table, take a unload of data.
Thanks
Rags |
|
Back to top |
|
|
ANIKET
New User
Joined: 28 Apr 2005 Posts: 11 Location: PUNE
|
|
|
|
Ragshere,
I think creating unique index on those two column will do the work. Try it. |
|
Back to top |
|
|
ANIKET
New User
Joined: 28 Apr 2005 Posts: 11 Location: PUNE
|
|
|
|
Please ignore my previous comment. Ragshere is right. You have to drop the table and recreate it with all the parameters you want.
Creating Unique index on new two columns will restrict any null value as well any duplicate data value. And I think you don?t want second criteria. So recreating table is the only remaining option. |
|
Back to top |
|
|
|