Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
NULL behavior change with SET ENGINEBEHAVIOR
Message
 
 
To
11/11/2015 16:50:24
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01627348
Message ID:
01627349
Views:
54
>Hi all,
>
>Just wanted to confirm this as I could not find anything in the help file.
>
>On an old report, SET ENGINEBEHAVOIR was defaulting to 70. A query in the procedure for the report would work fine:
>
>
>
>dimension laTotals[2]
>STORE 0 TO laTotals
>
>SELECT ;
>   COUNT(*) AS NumInvoices, SUM(InvoiceTotal) AS Total ;
>   FROM......WHERE....
>   INTO ARRAY laTotals
>
>
>If nothing matched the condition, previously the array would not be "touched" and the results would be inserted into a cursor (along with many others). That is, both elements of the array would remain at the default zero.
>
>I am now upgrading the report writer and am defaulting to SET ENGINEBEHAVIOR 90. Under this setting, the array is now altered even if no records match the condition. In this case, the array contains:
>
>
>laTotal[1] = 0
>laTotal[2] = .NULL.
>
>
>So the report failed as the receiving cursor was not set to accept nulls.
>
>I could not find anything in the help file about this change with SET ENGINEBEHAVIOR. Just wanted to confirm as I can work around the change but am wondering if there is another "SET" command to easily work around this (with keeping SET ENGINE at 90) or do I have to check all reports that use this old "technique".
>
>Albert

This is correct behavior. SQL Server returns 0 as well when where condition returns 0 rows for the COUNT.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform