Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SELECT-SQL INTO ARRAY returns a NULL value
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro Beta
Divers
Thread ID:
00912356
Message ID:
00912947
Vues:
16
>
>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--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform