IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Alter Null Column to not null with default value


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Thu Oct 09, 2008 5:20 pm
Reply with quote

Hi All,

I want to alter nullable column to not null with default .
I have a table employee it contain some col

Emp-Depart char(16) ;

want to change it to
Emp-Depart char(16) not null with default 'training';

One way it to add constraint
ALTER TABLE <TABLENAME> ADD CONSTRAINT NULL_FIELD CHECK (<FIELD> IS NOT
NULL)

But it will not contain default value...

Please advise.
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Thu Oct 09, 2008 6:45 pm
Reply with quote

Hello All,

Just to add that we are using db2v8.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts How to load to DB2 with column level ... DB2 6
No new posts RC query -Time column CA Products 3
No new posts DROP & ALTER PARTITION-PBR DB2 0
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
Search our Forums:

Back to Top