By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,590 Members | 2,191 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,590 IT Pros & Developers. It's quick & easy.

Adding a not null column to a table with 0 rows

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.