467,923 Members | 1,766 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,923 developers. It's quick & easy.

Adding a not null column to a table with 0 rows

Hi,

Why is it that an Alter statement on a table adding a not null column
gives an error "SQL0193N" even though the table has no rows.
I guess DB2 should see that since there are no rows in the table, we
can just go ahead and add the not nullable column.

I am sure there is some specific reason that DB2 doesn't allow the
addition of not null columns to a table already created but having no
rows.

Thanks

Rahul

Aug 23 '07 #1
  • viewed: 2144
Share:
1 Reply
Rahul B wrote:
Hi,

Why is it that an Alter statement on a table adding a not null column
gives an error "SQL0193N" even though the table has no rows.
I guess DB2 should see that since there are no rows in the table, we
can just go ahead and add the not nullable column.

I am sure there is some specific reason that DB2 doesn't allow the
addition of not null columns to a table already created but having no
rows.
Add a WITH DEFAULT clause

Cheers
Serge

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Aug 28 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by Bodza Bodza | last post: by
5 posts views Thread by Paul | last post: by
3 posts views Thread by Claudio Lapidus | last post: by
2 posts views Thread by Gail Zacharias | last post: by
3 posts views Thread by Jim Heavey | last post: by
16 posts views Thread by Geoff Jones | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.