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 

set null to a field

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


Joined: 15 Apr 2005
Posts: 26
Topics: 9

PostPosted: Tue Apr 19, 2005 5:04 pm    Post subject: set null to a field Reply with quote

hi,
I have a question on setting a Null to some of the fields in DB2. I have the below in my Easytrieve Program

SQL UPDATE AB.TABLE1
SET FIELD1 = :WS-VAR1
, FIELD2 = :WS-VAR2
, FIELD3 = :WS-VAR3
WHERE
< SOME CONDITIONS >

My question is, based on some conditions I need to set FIELD1 or FIELD2 as NULLs, how can I set NULLs to these FIELDS in my program

Thanks in advance
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Tue Apr 19, 2005 6:30 pm    Post subject: Reply with quote

Bullfighter,

It is very easy to update a column to null. Try this

Code:

SQL UPDATE AB.TABLE1              +
       SET FIELD1 = NULL          +
          ,FIELD2 = NULL          +
          ,FIELD3 = :WS-VAR3      +
     WHERE < SOME CONDITIONS >


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
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