Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SELECT-SQL INTO ARRAY returns a NULL value
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro Beta
Miscellaneous
Thread ID:
00912356
Message ID:
00912947
Views:
15
>
>I too used to initialize the array prior to the SELECT, but I found I could streamline the code a bit by testing _TALLY, and if it was zero, I knew the array wouldn't be created. But now in VFP9, the array will always be created. I must say, having a bunch of controls saying ".NULL." will get your attention. :-)

Hi John,

An array will only be created when query returns non-zero # records. The ANSI SQL standard requires that query with aggregate function return a record with Nulls for empty result set. VFP9 is now compliant with the standard in this part.
CREATE CURSOR testxx (ii int, cc char)
SELECT * FROM testxx INTO CURSOR crsTest
? _TALLY    && 0 - still returns zero because there're no aggragate functions 
SELECT SUM(ii) AS sum1 FROM testxx INTO CURSOR crsTest
? _TALLY, sum1    && 1, Null
SELECT MAX(ii) max1 FROM testxx INTO CURSOR crsTest
? _TALLY          && ? _TALLY, max1    && 1, Null
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform