Alter Column from NOT NULL to NULLABLE and / or vice versa
Select messages from
# through # FAQ
[/[Print]\]

MVSFORUMS.com -> Database

#1: Alter Column from NOT NULL to NULLABLE and / or vice versa Author: bauerLocation: Germany PostPosted: 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 CloustonLocation: At Home PostPosted: 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: bauerLocation: Germany PostPosted: 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: kolusuLocation: San Jose PostPosted: 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: bauerLocation: Germany PostPosted: Fri Nov 03, 2017 3:34 pm
    —
Kolusu,
thank you for your confirmation.
Kind regards,
Bauer



MVSFORUMS.com -> Database


output generated using printer-friendly topic mod. All times are GMT - 5 Hours

Page 1 of 1

Powered by phpBB © 2001, 2005 phpBB Group