Null
Hi,
I fully agree with the explanation given by gandolf989.
Actually my problem is that I am loading data using SqlLoader into a table TEMP_SUBS.
Desc TEMP_SUBS
Sbcr_Id number(9)
Sbcr_Code varchar2(1)
Some junk values are coming in Sbcr_Code field.
When I query the table....
select count(*) A,nvl(sbcr_Code,'n') B
from temp_subs
group by nvl(sbcr_Code,'n')
I get the following result :
Output
A B
------------------
53078
27047 R
8790 S
9985 T
67983 n
select count(*) from temp_subs
where sbcr_code =' ' ---Checking for Space
Output:
-------
No Rows Selected
select count(*) from temp_subs
where sbcr_code is null ---Checking for Null
Output:
-------
67983
Select count(*),ascii(sbcr_code) from temp_subs
group by ascii(sbcr_code);
Output
-------
53078 0
27047 82
8790 83
9985 84
67983
And Ascii of NULL is Zero !!!
Which means that these 53078 are also having value as NULL ???
But NVL function is not working these cases and condition "Where sbcr_code is null" returns only 67983 rows.
Does oracle treats chr(0) different fron Null ??
If yes then why ??
Plz also suggest some suitable way to get rid on these values while
loading my table.
Ofcourse, I don't want to update these values to Null every time.
Thanks
RP Kumar
You Can Win, if u believe Yourself