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 14:11:34
 
 
À
16/02/2001 13:40:57
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00476591
Message ID:
00476757
Vues:
25
>Dragan,
>
>On a similar subject I have been using ALTER TABLE after a SELECT to get rid of columns I don't want. I always wished there was a command like SELECT * EXCEPT Table1.MyField...
>

Actually a SELECT using only the fields you need would be faster than a SELECT *. Some backends actually take quite a long time to process the "*" into a field list.

It would definitely be faster than doing the SELECT * and ALTER TABLE to remove the columns later.


>Instead of listing each field in the SELECT, I sometimes do
>
>SELECT * FROM orders INNER JOIN ordItems ON orders.order_id=ordItems.order_id INTO CURSOR MyCursor
>USE (DBF()) AGAIN IN 0 ALIAS ReadWrite
>USE
>ALTER TABLE ReadWrite DROP COLUMN order_id_b
>ALTER TABLE ReadWrite RENAME COLUMN order_id_a TO order_id
>
>
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform