MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Update nulls

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
monaco
Beginner


Joined: 20 May 2004
Posts: 77
Topics: 31

PostPosted: Wed Jul 28, 2004 3:24 am    Post subject: Update nulls Reply with quote

Hi all,

i have a table which accepts nulls in two columns (char and decimal). i want this table doent accept nulls.
The problem is how to convert the data which is already in the table.

How can i reload the data which is already in the table if the table doesnt accept nulls anymore?

Kind regards.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12380
Topics: 75
Location: San Jose

PostPosted: Wed Jul 28, 2004 5:20 am    Post subject: Reply with quote

monaco,

You need to ALTER the column definitions so that in future they will not have any nulls.

Check this link

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DSNSQH11/5.10?DT=20010718164132

You can easily update the null columns. Try this

Code:


 UPDATE TABLE SET COL1 = 'SOME VALUE' WHERE COL1 IS NULL
 UPDATE TABLE SET COL2 = 0 WHERE COL2 IS NULL



Check this link for NULL predicate

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DSNSQH11/2.21.7?SHELF=&DT=20010718164132&CASE=

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
monaco
Beginner


Joined: 20 May 2004
Posts: 77
Topics: 31

PostPosted: Wed Jul 28, 2004 12:06 pm    Post subject: Reply with quote

Thanks a lot.

It is very usefull.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group