Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Array is Bonkers
Message
De
09/02/2004 13:18:44
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00875521
Message ID:
00875544
Vues:
21
Sergey

Thanks for your response.

The JOBS table has TWO records with the specified GROUPID: "GRP10000009"

I cut'n'pasted your example. Here's what I get:

SET STEP ON
RELEASE jArray
LOCAL ARRAY jArray[1]
SELECT jobs.JobName, jobs.JobID FROM JOBS ;
WHERE GROUPID = "GRP10000009" ;
INTO ARRAY jArray
IF _TALLY = 0
* No records selected, jArray hasn't been changed
ENDIF

Your jArray is dimensioned as ONE element. When the SELECT executes it populates THAT ELEMENT with
only ONE of the TWO records present in the JOBS table that have the requested GROUPID. The resultant array has only ONE element populated with the Jobs.JobName field content. It is not redimensioned to hold the actual results.

NOW....Here's the good part:

In the Debugger, if I look at the Locals window I see an array jarray---jarray[1] with a single value of the JOBS.JobName of the first record only. If, however, I look at the Watch window where I've entered jarray as the var to Watch, I see a CORRECT array with values from BOTH Jobs records and 4 elements.

This is strange...

Thanks

David
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform