MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Alter Column from NOT NULL to NULLABLE and / or vice versa

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
bauer
Intermediate


Joined: 10 Oct 2003
Posts: 282
Topics: 40
Location: germany

PostPosted: Wed Oct 25, 2017 8:00 am    Post subject: Alter Column from NOT NULL to NULLABLE and / or vice versa Reply with quote

Dear all,

I have a DB2 Version 10 subsystem for zOS.

I like to change a column from NOT NULL to NULLABLE and / or from NULLABLE to NOT NULL.

I checked the syntax trees in the IBM documentation. It seem's to me, what this doesn't work by SQL (ALTER TABLE .......).

Is this understanding correct or did I miss something?

Thus the possible solution is to unload the data, drop, create table and reload.

Any comments?

regards,
bauer
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 995
Topics: 6
Location: At Home

PostPosted: Wed Oct 25, 2017 9:26 am    Post subject: Reply with quote

If the manual does not tell you how to do it then it cannot be done - at least, not by ALTER.
_________________
Utility and Program control cards are NOt, repeat NOT, JCL.
Back to top
View user's profile Send private message
bauer
Intermediate


Joined: 10 Oct 2003
Posts: 282
Topics: 40
Location: germany

PostPosted: Wed Oct 25, 2017 9:43 am    Post subject: Reply with quote

Nic,

thank you - so I did not miss anything during my manual reading.

DROP TABLE / CREATE TABLE is the way.

Thank you and have a nice day,
bauer
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 11813
Topics: 74
Location: San Jose

PostPosted: Wed Oct 25, 2017 11:11 am    Post subject: Reply with quote

bauer,

DB2 on z/OS does not allow you to change the column attributes to NULL . As you have figured it out, you need to DROP and recreate the table.
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
bauer
Intermediate


Joined: 10 Oct 2003
Posts: 282
Topics: 40
Location: germany

PostPosted: Fri Nov 03, 2017 3:34 pm    Post subject: Reply with quote

Kolusu,
thank you for your confirmation.
Kind regards,
Bauer
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group