|
-
Apr 1st, 2009, 08:15 AM
#1
CHR(0) - not the same as NULL
Does anyone have any documentation on CHR(0). I found this on geekinterview, but other than that, I have nothing.
I have looked in Oracle documentation, but I couldn't find it.
Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
save a blobFileStreamDataTable To Text Filemy blog
-
Apr 1st, 2009, 09:23 AM
#2
Re: CHR(0) - not the same as NULL
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
-
Apr 1st, 2009, 12:41 PM
#3
Re: CHR(0) - not the same as NULL
 Originally Posted by techgnome
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.
Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
save a blobFileStreamDataTable To Text Filemy blog
-
Apr 1st, 2009, 01:07 PM
#4
Re: CHR(0) - not the same as NULL
In the beginning there was ASCII
-
Apr 1st, 2009, 01:24 PM
#5
Re: CHR(0) - not the same as NULL
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.
-
Apr 1st, 2009, 01:39 PM
#6
Re: CHR(0) - not the same as NULL
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
-
Apr 1st, 2009, 02:00 PM
#7
Re: CHR(0) - not the same as NULL
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.
-
Apr 1st, 2009, 02:44 PM
#8
Re: CHR(0) - not the same as NULL
 Originally Posted by Pradeep1210
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. 
Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
save a blobFileStreamDataTable To Text Filemy blog
-
Apr 1st, 2009, 02:54 PM
#9
Re: CHR(0) - not the same as NULL
-
Apr 1st, 2009, 03:06 PM
#10
Re: CHR(0) - not the same as NULL
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.
-
Apr 1st, 2009, 03:08 PM
#11
Re: CHR(0) - not the same as NULL
I am from Missouri, so I like that suggestion.
-
Apr 1st, 2009, 03:11 PM
#12
Re: CHR(0) - not the same as NULL
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?
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|