467,198 Members | 1,269 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,198 developers. It's quick & easy.

Space instead of Null

Can we use the word “space”(instead of null) in DB2 query.

I have given You the query here.



EXEC SQL UPDATE DOEORDER

SET CHRG_CARD_NBR = SPACE

WHERE ADD_TO_DB_DT < '2006-06-01'

END-EXEC.

Is this a right one.

SET CHRG_CARD_NBR = SPACE
Jul 12 '07 #1
  • viewed: 4000
Share:
2 Replies
MindBender77
100+
Can we use the word “space”(instead of null) in DB2 query.

I have given You the query here.



EXEC SQL UPDATE DOEORDER

SET CHRG_CARD_NBR = SPACE

WHERE ADD_TO_DB_DT < '2006-06-01'

END-EXEC.

Is this a right one.

SET CHRG_CARD_NBR = SPACE

You might want to try: SET CHRG_CARD_NBR = " "
A space keystroke between quotes should work. I would try a select statement using the " " to make sure your updating the correct data.
Jul 16 '07 #2
SPACE is not the same as NULL

So it is better to use if the column to be updated is a nullable column

EXEC SQL UPDATE DOEORDER

SET CHRG_CARD_NBR = NULL

WHERE ADD_TO_DB_DT < '2006-06-01'
Jul 23 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

11 posts views Thread by kenneth@nospam.nospam | last post: by
5 posts views Thread by N | last post: by
37 posts views Thread by hasadh | last post: by
6 posts views Thread by JackC | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.