Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Any side effects in allowing NULL?
Message
 
 
À
31/03/2012 12:41:57
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01539772
Message ID:
01539946
Vues:
52
>>>What if the field is a year where -20,000,000 -> +20,000,000 are valid values (unless you are a creationist). What shall we you use then for 'unknown' . -1 and 999 will be a bit ambiguous....
>
>Ah.. you ask hard ones, Viv!
>Actually, it's even more complicated.
>There really are 3 conditions:
>1-Known and stated.
>2-Unknown - meaning the user has affirmatively said that this information is not known
>3- The user hasn't gotten around to populating this field yet (I call that unspecified, or in the neutral state) If there ever were a case for NULL, it might be here, but I still would find another way.
>
>Most of the time, 2 and 3 are functionally synonymous and we'll let them be so in this case to move things along.
>
>In COBOL we had handy things called HIGH VALUES and LOW VALUES that returned the highest and lowest numbers the current operating platform could produce.
>
>My first thought would probably be to use something similar in this case, but the real answer is that I'd have to know more about the application before I could answer.

There is NO value which is theoretically equivalent to null. Null means "We don't know." Repeating myself, I hate magic numbers.

This has been the most interesting developer thread here in quite a while IMO.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform