User Profile

Collapse

Profile Sidebar

Collapse
craigbert
craigbert
Last Activity: May 11 '11, 04:38 PM
Joined: Jan 11 '11
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • craigbert
    replied to How to alter a column from NULL to NOT NULL?
    in DB2
    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:...
    See more | Go to post

    Leave a comment:


  • craigbert
    replied to How to alter a column from NULL to NOT NULL?
    in DB2
    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:
    Code:
    ALTER TABLE bar ALTER COLUMN C1 SET NOT NULL
    But when I use that syntax I get the following error:
    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
    ...
    See more | Go to post

    Leave a comment:


  • craigbert
    replied to How to alter a column from NULL to NOT NULL?
    in DB2
    Does the silence mean that there is not a way to do this w/o dropping and recreating the table?
    See more | Go to post

    Leave a comment:


  • craigbert
    started a topic How to alter a column from NULL to NOT NULL?
    in DB2

    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
    See more | Go to post
No activity results to display
Show More
Working...