JUKe & Rabbit,
Here is what I have tried w/o any luck:
ALTER TABLE DEPT ALTER COLUMN LD2_IN DROP NOT NULL;
returns the following error:
ERROR [42601] [IBM][DB2] SQL0104N An unexpected token "DROP" was found following "". Expected tokens may include: "RESTART". SQLSTATE=42601
ALTER TABLE DEPT ADD CONSTRAINT CK01A(LD2_IN IS NULL);
returns the following error:...
User Profile
Collapse
-
Rabbit,
Thanks for the reply.
Your initial guess is correct.
When I look at the IBM DB2 v9 manual online this is the syntax I see:
But when I use that syntax I get the following error:Code:ALTER TABLE bar ALTER COLUMN C1 SET NOT NULL
...Code:Category Timestamp Duration Message Line Position Error 1/13/2011 10:49:33 AM 0:00:00.171 <link> - DB2 Database Error: ERROR [42601] [IBM][DB2] SQL0104N
Leave a comment:
-
Does the silence mean that there is not a way to do this w/o dropping and recreating the table?Leave a comment:
-
How to alter a column from NULL to NOT NULL?
Hello All,
I am having problems finding the correct syntax for changing a column from NULL to NOT NULL.
We are using DB2 on z/OS.
I have tried:
ALTER TABLE TEST_CB ALTER COLUMN TEST_CHAR NOT NULL;
ALTER TABLE TEST_CB ALTER COLUMN TEST_CHAR SET NOT NULL;
And a couple others, but no luck.
Thanks,
Craigbert
No activity results to display
Show More
Leave a comment: