View previous topic :: View next topic |
Author |
Message |
bauer Intermediate
Joined: 10 Oct 2003 Posts: 315 Topics: 49 Location: Germany
|
Posted: Wed Oct 25, 2017 8:00 am Post subject: Alter Column from NOT NULL to NULLABLE and / or vice versa |
|
|
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 |
|
|
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Wed Oct 25, 2017 9:26 am Post subject: |
|
|
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 |
|
|
bauer Intermediate
Joined: 10 Oct 2003 Posts: 315 Topics: 49 Location: Germany
|
Posted: Wed Oct 25, 2017 9:43 am Post subject: |
|
|
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 |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Wed Oct 25, 2017 11:11 am Post subject: |
|
|
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
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
bauer Intermediate
Joined: 10 Oct 2003 Posts: 315 Topics: 49 Location: Germany
|
Posted: Fri Nov 03, 2017 3:34 pm Post subject: |
|
|
Kolusu,
thank you for your confirmation.
Kind regards,
Bauer |
|
Back to top |
|
|
|
|