>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