Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is there a way to determine if field contains NULL or no
Message
From
11/10/2001 14:33:41
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00567112
Message ID:
00567156
Views:
15
>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform