The column PRC_MSTR_ID is char(20)
I am trying to unload some data from db2 using ikject01 util.
While doing so
I first tried with
IFNULL(PRC_MSTR_ID,' ')
in the output file only one byte is replaced and rest of the 19 bytes are nulls.
2nd:
IFNULL(PRC_MSTR_ID,Space(20))
this gives all the 20 byte as spaces.
3rd:
One of my friend suggested like
IFNULL(PRC_MSTR_ID,CHAR(' ')) or CHAR(IFNULL(PRC_MSTR_ID,' '))
both the statement resulted in all the 20 bytes as spaces.
- My doubt is
- 1)if I give CHAR(' ') only one byte has to converted to character,but how come all the 20 bytes are converted to spaces. I asked him but he is also not aware of how this is happening.
- 2)
CHAR(IFNULL(PRC_MSTR_ID,' ')) is as similar to CHAR(1st statement)
Thanks in Advance