Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
View Bug (reprise)
Message
From
05/02/1999 15:18:51
Eric Barnett
Barnett Solutions Group, Inc
Sonoma, California, United States
 
 
To
05/02/1999 14:02:32
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00184361
Message ID:
00184500
Views:
24
You are absolutely right - I duplicated the scenario you described and got the same results. I noticed something even wierder about it. After adding the record, before modifying any data in the view, select the view alias. Move the pointer to the new record, and try ? GETFLDSTATE(-1). It returns .NULL.! It should never return NULL, in this case it should return 33333...If you set buffering to table, it returns the 3s but still updates the values wrong.

You might have acutally found a bug here.

>Yes I am - but remember, they CORRECTLY show as .null. in the view when appended.
>Ken
>
>>Are you adding records to the view with APPEND BLANK? If so you will get BLANK values (i.e. 0 for a numeric field) instead of the .NULL. you might expect. You have to either specify the .NULL. programmatically, or use a default in the view.
>>
>>This is one of those cases where VFP doesn't behave like SQL server (which will insert .NULL. for all blank values) but probably should. It's probably this way because DBFs got NULL support late and assuming .NULL. might break a lot of older apps.
>>
>>INSERT - SQL will cause the same problem if you don't explicitly set the value of the field to .NULL.
>>
>>>(I posted this yesterday, but it might have got lost in the mix - so here goes again)
>>>
>>>Ok - noticed a behavior today that I had missed before. I have a table with integer fields. These accept .NULL. values but I did NOT set them up to default null. I also have a view that updates this table. The corresponding view fields to those integer table fields ARE set up to default to .NULL. in the view.
>>>
>>>Problem/Bug: If I insert new record in view, the fields correctly get .NULL. in the view. However, when I tableupdate, it is being inserted into the table fields as 0 (zero) instead of .NULL. If, however, I actually replace the fields in the view with .NULL. (even though .null. is already there) - either programmatically or with Ctrl-0 - before I tableupdate, it works correctly. Can anyone confirm or comment on this?
>>>
>>>VFP5.0a / WIN98 / Set Null is offf / can reproduce in command window
>>>
>>>Thanks,
>>>Ken
Eric Shaneson
Cutting Edge Consulting
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform