Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Tip o' the Day: ALTER TABLE on a Cursor
Message
De
16/02/2001 12:54:05
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
16/02/2001 02:14:13
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00476591
Message ID:
00476716
Vues:
23
>>I just found out this works, with a caveat (at least in VFP5). I used a complex SELECT - SQL to generate a report cursor. I wanted to add a memo column to the resultant cursor:
* Report cursor:
>>SELECT ;
>>  ... ;
>>  INTO CURSOR MyCursor ;
>>  ...
>>
>>* Make the cursor read-write:
>>USE ... AGAIN etc.
>>
>>* Add the memo column:
>>ALTER TABLE ... ADD COLUMN MyMemo M
>>
>>BTW can anyone confirm if this works in VFP6?
>
>Yep, this still works in VFP6. Now, can someone tell us if it works with VFP7 and just using the READWRITE clause of the SELECT and the ALTER TABLE?

It complained about the table being still open elsewhere - it worked only after I closed the original r/o cursor. Does make sense, that one was read only, and was open in another workarea.

This thing should actually gain us some speed, specially when we had to include dummy fields in a select statements to be placeholders for later additions - we now can do them outside of the SQL statement. What I'm saying is that instead of
select ..., space(40) as name, ...
we can now do the select without this, and add the field afterwards. This should lift some burden off SQL's back.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform