Click to See Complete Forum and Search --> : CHR(0) - not the same as NULL
abhijit
Apr 1st, 2009, 09:15 AM
Does anyone have any documentation on CHR(0). I found this (http://www.geekinterview.com/talk/12425-chr-0-a.html) on geekinterview, but other than that, I have nothing.
I have looked in Oracle documentation, but I couldn't find it.
:wave:
techgnome
Apr 1st, 2009, 10:23 AM
Essentially NULL means UNKNOWN .... and yes CHR(0) is not the same. CHR(0) is the Null Character... which isn't NULL... huh? Wha? And I see that I'm essentially repeating what is in that link. What is it that you are looking for?
-tg
abhijit
Apr 1st, 2009, 01:41 PM
Essentially NULL means UNKNOWN .... and yes CHR(0) is not the same. CHR(0) is the Null Character... which isn't NULL... huh? Wha? And I see that I'm essentially repeating what is in that link. What is it that you are looking for?
-tg
Some documentation to convince my boss.
:wave:
dbasnett
Apr 1st, 2009, 02:07 PM
In the beginning there was ASCII (http://www.asciitable.com/)
dilettante
Apr 1st, 2009, 02:24 PM
Actually the ASCII character is usually written as NUL and not Null. Of course then again you have vbNullChar as the instrinsic constant for it, so go figure. But then you have vbNullString too, which is not the same as "" though it gets abused as such a lot.
I'm not sure why anyone would confuse it with the concept of Null, the Variant subtype though. This what a database Null is returned as.
techgnome
Apr 1st, 2009, 02:39 PM
That's why I see a difference between Null (Chr(0)) and NULL (unknown... usually associated with database NULL "value") .... it doesn't help that .NET returns NULL Reference errors on uninstanciated objects (although, if you look at NULL as being unknown, there's an arguement that the error is infact correct, it's a pointer to an unknown location... *shrug*)
I'm not sure one is going to find such documentation. At best, you'll find discussions like this one where the difference is contemplated... but nothing concrete... but then again...
-tg
Pradeep1210
Apr 1st, 2009, 03:00 PM
Both are different anyways, and there should be no confusion.
NULL = empty space whose value is not known. It may have some junk value but that too is not guaranteed.
CHR(0) = the character with ASCII code 0 which is called null character.
abhijit
Apr 1st, 2009, 03:44 PM
Both are different anyways, and there should be no confusion.
NULL = empty space whose value is not known. It may have some junk value but that too is not guaranteed.
CHR(0) = the character with ASCII code 0 which is called null character.
NVL function can check for a null, but cannot check for a CHR(0).
I agree both are different, but I need some document. Maybe I should try sending my boss to this forum. :eek:
:wave:
dbasnett
Apr 1st, 2009, 03:54 PM
http://www.databasedesign-resource.com/null-values-in-a-database.html
Pradeep1210
Apr 1st, 2009, 04:06 PM
Better show him practically rather than pointing him to some article etc.
Create a table with just one field which allows NULLs.
Then add two records.. one that has NULL and other that has Chr(0).
Run various queries and show him that both are different.
dbasnett
Apr 1st, 2009, 04:08 PM
I am from Missouri, so I like that suggestion.
dilettante
Apr 1st, 2009, 04:11 PM
For a text field in a database a SQL NULL means "no value was supplied." If there is a NUL character then the field has one character with all bits zero.
What's so tough?
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.