Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to append from a Cursor
Message
De
30/08/2000 17:55:36
 
 
À
30/08/2000 16:20:51
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00410983
Message ID:
00411073
Vues:
18
>>>Is it possible to create a cursor from a SQL SELECT and then APPEND FROM to an existing table?
>>
>>Sure
>>
>>SELECT * FROM table INTO CURSOR mycursor NOFILTER
>>SELECT anothertable
>>APPEND FROM (DBF("mycursor"))

>>
>>You could also SELECT ... INTO ARRAY then APPEND FROM ARRAY instead - depending on the size of the returned data set.
>
>I changed to an array and it gets done what I need, thanks!

I thought I posted a question but I must have done something wrong because it hasn't appeared. Anyhow the question was how to trap an empty array and the answer is:

After the SELECT, check the _TALLY system variable - I'd store it off in a variable so it can be referred to later, if necessary (see _TALLY in help for more detail on why), e.g.
SELECT * FROM.... INTO ARRAY lax
lnCnt = _TALLY
IF lnCnt > 0
  SELECT table
  APPEND FROM ARRAY lax
ELSE
  MESSAGEBOX("No records found.")
  RETURN
ENDIF
Jim Philippi

quando omni flunkus moritati
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform