Subject Re: SQL WHERE Clause Not Working Since Upgrade to Plus 11
From Ken Mayer <dbase@nospam.goldenstag.net>
Date Wed, 20 Sep 2017 08:38:46 -0700
Newsgroups dbase.getting-started

On 9/20/2017 7:52 AM, Mervyn Bick wrote:
> On 2017-09-20 3:34 PM, Ken Mayer wrote:
>> On 9/20/2017 6:30 AM, Akshat Kapoor wrote:
>>>> This is incorrect. There is an application-wide setting:
>>>>
>>>> set autonullfields off // means don't use nulls
>>>> set autonullfields onĀ  // means use nulls
>>>>
>>>> queryname.rowset.autoNullFields := false // turn off null fields for
>>>> a specific rowset object
>>>>
>>>
>>> This works. I just checked it.
>>>
>>> Maybe I was over cautious in assigning values to each and every field
>>> after beginappend()
>>>
>>> As null plays havoc with coding and have seen multiple cases on the
>>> newsgroup due to this
>>
>> Well, you're doing more work than needed, honestly. The autoNullFields
>> setting works perfectly ...
>
> Set autonullfields off works with oRowset.beginAppend() but it doesn't
> work where the localSQL INSERT is used.
>
> To deal with network performance issues Akshat is using the localSQL
> commands instead of the rowset methods so always writing an appropriate
> default value where he's not actually saving a specific value to a field
> is extra work but it's not really overkill. :-)
>
> If the default values are set by using the Inspector from the table
> designer these values get written into the .dbf header and they are
> written to the table records by the localSQL INSERT command.

The problem with using the defaults like that is that not all table
formats have them, so if he decides to move his data to a SQL server,
this may not work.

You are correct that local SQL probably doesn't work with these
settings, that's a BDE limitation/implementation issue.

If Akshat must do things this way, perhaps this is where a Data Module
might be handy, with a custom append option that sets up default values
automatically ...?

Ken


--
*Ken Mayer*
Ken's dBASE Page: http://www.goldenstag.net/dbase
The dUFLP: http://www.goldenstag.net/dbase/index.htm#duflp
dBASE Books: http://www.goldenstag.net/dbase/Books/dBASEBooks.htm
dBASE Tutorial: http://www.goldenstag.net/dbase/Tutorial/00_Preface.htm