Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select SQL into a cursor
Message
De
03/12/1997 18:57:37
 
 
À
03/12/1997 17:03:00
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00063640
Message ID:
00063670
Vues:
48
>>I have a ComboBox that I would like to list all of the records in a file but I also would like the first entry in the combo box to say "None" or whatever. I thought I would put the "none" record in a cursor and then append the records from the table through a select sql. Well when I do that I lose the "none" record. Is there a way to get all of the records into a cursor from a table using Select SQL and then adding one more record to that cursor?
>
>Create Cursor tmp1 (Name C(20))
>Select field1 From table1 Into array tmpArray
>Insert Into tmp1 from array tmparray
>Insert Into tmp1 Values("None")

Maybe faster:

CREATE CURSOR Tmp2 (Name C(20))
INSERT INTO Tmp2 (Name) VALUES ("None")
SELECT Name FROM Tmp2 INTO CURSOR Tmp1;
UNION (SELECT Field1 AS Name FROM Table1)
USE IN Tmp2

This is also a little less risky since it doesn't use an array.

Vlad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform