?
Solved

ALTER COLUMN in DB2

Posted on 2005-05-06
2
Medium Priority
?
3,979 Views
Last Modified: 2009-01-09
Hey!
I'm working with DB2 8.0 and I want to modify a nullable column to not nullable column. But, I don't know how to do it.
It's very very easy this question, suppose this table

create table table_1
(
   te1_id INTEGER,
   te1_description VARCHAR(50)
);

I want modify column te1_id to not nullable column.

Regards!


0
Comment
Question by:mjuri
2 Comments
 
LVL 25

Accepted Solution

by:
jrb1 earned 150 total points
ID: 13948220
alter table table_1 add check (te1_id is not null)
0
 
LVL 57

Expert Comment

by:Raja Jegan R
ID: 23333709
You can do
alter table alter column column_name set not null
0

Featured Post

NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
In this article, I’ll look at how you can use a backup to start a secondary instance for MongoDB.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question