Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Any side effects in allowing NULL?
Message
De
01/04/2012 02:02:56
 
 
À
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:
01539923
Vues:
59
>>>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.

The problem with high and low values is twofold.
(a) As you yourself point out, they depend on the platform.
(b) Both are also actual valid values.

In fact, the .Net framework has a similar concept. There are MaxValue and MinValue values for, say, the double structure but in addition there are also NegativeInfinity and PositiveInfinity values. And, because a double is not nullable (:-}), there's also Double.NaN (not a number) . Don't know what happens when they are pushed to a database tho....
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform