Hi,
What is the purpose of a null variable in real world? One of the document says, that when a value is not present it is NULL. What is the meaning of it? Can not a proper value showing what the column or row means will do the same thing for a programmer? Can someone please help inthis.
What is the purpose of a null indicator variable?
Re: What is the purpose of a null indicator variable?
Null is nothing - not zero, not a space, not anything - NOTHING. If you do not supply a value or default value then the variable has no content as far as you are concerned. Therefore, as there is nothing to test against you need a NULL indicator. As you should have known this from day one of yur SQL training you should have been able to discerne what a NULL indicator varible was. As you would have found from a simle internet search - or better - a search of the IBM manuals.
Regards
Nic
Nic
- Robert Sample
- Global Moderator
- Posts: 1891
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: What is the purpose of a null indicator variable?
"Real world" data tends to be messy and incomplete. A NULL indicates the data value is not known (there are many reasons this may happen). For example, if you're putting geneologic or demographic data into a database and there is a column NUMBER_OF_CHILDREN, there is a VAST difference between NULL (that is, the number of children are not known) and zero (that is, the number of children is known and the count is zero).
Re: What is the purpose of a null indicator variable?
I think I understand what you mean!nicc wrote:Null is nothing - not zero, not a space, not anything - NOTHING. If you do not supply a value or default value then the variable has no content as far as you are concerned. Therefore, as there is nothing to test against you need a NULL indicator.
Re: What is the purpose of a null indicator variable?
Thanks for your example Robert. It helps to understand it better. I'll read more about NULL to get more knowledge about them.Robert Sample wrote:"Real world" data tends to be messy and incomplete. A NULL indicates the data value is not known (there are many reasons this may happen). For example, if you're putting geneologic or demographic data into a database and there is a column NUMBER_OF_CHILDREN, there is a VAST difference between NULL (that is, the number of children are not known) and zero (that is, the number of children is known and the count is zero).
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute