Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Real Problem
Message
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00549508
Message ID:
00549510
Vues:
18
>I want to copy the data from a table say "BATCH_TEST" to another table whose name I donot know and the name can be picked from the Variable. I tried like this
>
> mvar_name = "Table_name" where Table_Name is the table name I want to use.
>
> To copy the structure of already existring table, I can do like
> Use BATCH_TEST
>copy structure to substr(mvar_name,1)
>
> and the new table is created by the name table_name.dbf. Now I want to transfer the data also by using the variable name instead of table name
>
> say
> insert into substr(mvar_name, 1)(x,y,z)values(BATCH_TEST.x....
> this gives me syntax error. Is there any other way to do so.
>
>
>Thanks
>Bharat

Try something like this:
COPY TO (mvar_name)
The parenthesis arount the variable name tells VFP to use the value in the variable as the filename. I don't think you need to use substr in this case either.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform