#1: Alter Column from NOT NULL to NULLABLE and / or vice versa Author: bauer, Location: GermanyPosted: Wed Oct 25, 2017 8:00 am 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
#2: Author: Nic Clouston, Location: At HomePosted: Wed Oct 25, 2017 9:26 am If the manual does not tell you how to do it then it cannot be done - at least, not by ALTER.
#3: Author: bauer, Location: GermanyPosted: Wed Oct 25, 2017 9:43 am 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
#4: Author: kolusu, Location: San JosePosted: Wed Oct 25, 2017 11:11 am 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.
#5: Author: bauer, Location: GermanyPosted: Fri Nov 03, 2017 3:34 pm Kolusu,
thank you for your confirmation.
Kind regards,
Bauer