By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,851 Members | 1,746 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,851 IT Pros & Developers. It's quick & easy.

Space instead of Null

P: n/a
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
Share this Question
Share on Google+
2 Replies


MindBender77
100+
P: 234
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

P: 14
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.