Space instead of Null

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sajithamol

    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
  • MindBender77
    New Member
    • Jul 2007
    • 233

    #2
    Originally posted by sajithamol
    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.

    Comment

    • dewa81
      New Member
      • Jul 2007
      • 14

      #3
      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'

      Comment

      Working...