Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is there a way to determine if field contains NULL or no
Message
De
11/10/2001 14:33:41
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00567112
Message ID:
00567156
Vues:
16
>Sergey,
>
> This whole idea started from the following. My colleague wrote a DeNull program. This programs opens table exclusively and if field allows NULLs, changes it to not allow them. It doesn't check, whether file contains NULLs or not. First of all, this process may be slow on the huge files. Secondly, all of the sudden I had VFP crash today several times when it was running this program. It worked just fine few days ago, so I had no idea, what may cause this crash...

I really wouldn't know if the crash may be coming from a field being marked as Not Null while having nulls in some records.

I'd rather prevent the situation than get into analysis-paralysis with it. In the DeNull.prg, before setting a field to NotNull:
locate for isnull(eval(cFld))
if found()
   replace rest (cFld) with vDefaultValue for isnull(eval(cFld))
endif
Alter Table ...

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform